Поддержка Проблемы и решения проблема с отображением русских букв

  • При вставке кода html либо php в тело шаблона для вывода сегодняшней даты в русской интерпретации — выводятся каракули. Вот код

    <!-- Begin Sidebar -->
    			<div>
    				<ul>
    				<div id="adate">
    <?php
    /*
      these are the russian additional format characters
      д: full textual representation of the day of the week
      Д: full textual representation of the day of the week (first character is uppercase),
      к: short textual representation of the day of the week,
      К: short textual representation of the day of the week (first character is uppercase),
      м: full textual representation of a month
      М: full textual representation of a month (first character is uppercase),
      л: short textual representation of a month
      Л: short textual representation of a month (first character is uppercase),
    */
    function date_ru($formatum, $timestamp=0) {
      if (($timestamp <= -1) || !is_numeric($timestamp)) return '';
      $q['д'] = array(-1 => 'w', 'воскресенье','понедельник', 'вторник', 'среда', 'четверг', 'пятница', 'суббота');
      $q['Д'] = array(-1 => 'w', 'Воскресенье','Понедельник', 'Вторник', 'Среда', 'Четверг', 'Пятница', 'Суббота');
      $q['к'] = array(-1 => 'w', 'вс','пн', 'вт', 'ср', 'чт', 'пт', 'сб');
      $q['К'] = array(-1 => 'w',  'Вс','Пн', 'Вт', 'Ср', 'Чт', 'Пт', 'Сб');
      $q['м'] = array(-1 => 'n', '', 'января', 'февраля', 'марта', 'апреля', 'мая', 'июня', 'июля', 'августа', 'сентября', 'октября', 'ноября', 'декабря');
      $q['М'] = array(-1 => 'n', '', 'Января', 'Февраля', 'Март', 'Апреля', 'Май', 'Июня', 'Июля', 'Август', 'Сентября', 'Октября', 'Ноября', 'Декабря');
      $q['л'] = array(-1 => 'n', '', 'янв', 'фев', 'мар', 'апр', 'май', 'июн', 'июл', 'авг', 'сен', 'окт', 'ноя', 'дек');
      $q['Л'] = array(-1 => 'n', '',  'Янв', 'Фев', 'Мар', 'Апр', 'Май', 'Июн', 'Июл', 'Авг', 'Сен', 'Окт', 'Ноя', 'Дек');
    
      if ($timestamp == 0)
        $timestamp = time();
      $temp = '';
      $i = 0;
      while ( (strpos($formatum, 'д', $i) !== FALSE) || (strpos($formatum, 'Д', $i) !== FALSE) ||
              (strpos($formatum, 'к', $i) !== FALSE) || (strpos($formatum, 'К', $i) !== FALSE) ||
              (strpos($formatum, 'м', $i) !== FALSE) || (strpos($formatum, 'М', $i) !== FALSE) ||
              (strpos($formatum, 'л', $i) !== FALSE) || (strpos($formatum, 'Л', $i) !== FALSE)) {
        $ch['д']=strpos($formatum, 'д', $i);
        $ch['Д']=strpos($formatum, 'Д', $i);
        $ch['к']=strpos($formatum, 'к', $i);
        $ch['К']=strpos($formatum, 'К', $i);
        $ch['м']=strpos($formatum, 'м', $i);
        $ch['М']=strpos($formatum, 'М', $i);
        $ch['л']=strpos($formatum, 'л', $i);
        $ch['Л']=strpos($formatum, 'Л', $i);
        foreach ($ch as $k=>$v)
          if ($v === FALSE)
            unset($ch[$k]);
        $a = min($ch);
        $temp .= date(substr($formatum, $i, $a-$i), $timestamp) . $q[$formatum[$a]][date($q[$formatum[$a]][-1], $timestamp)];
        $i = $a+1;
      }
      $temp .= date(substr($formatum, $i), $timestamp);
      return $temp;
    }
    
    echo date_ru('Д, d м Y');
    
    ?> </div>
    <li class="widget"><h2>About <?php bloginfo('name'); ?></h2>
    						<ul>
    							<li class="non">
    								<p>Duis autem vel eum iriure dolor in hendrerit
    								in vulputate velit esse molestie consequat, vel illum dolore eu
    								feugiat. <a href="<?php bloginfo('home'); ?>/about/">More
    								&raquo;</a></p>
    							</li>
    						</ul>
    					</li>
    					<li class="widget"><h2>Categories</h2>
    						<ul id="categories">
    							<?php wp_list_categories('title_li=&show_count=1'); ?>
    						</ul>
    					</li>			
    
    				<?php 	/* Widgetized sidebar, if you have the plugin installed. */
    					if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('Left Sidebar') ) : ?>
                        <?php endif; ?>
    
    					</ul>
    			</div><!-- End Sidebar -->

    вот что выводится, и так с любыми вариациями, где есть русский текст.
    http://pic.ipicture.ru/uploads/090902/168NQzB6Wh.jpg
    Подскажите решение, пож…

Просмотр 5 ответов — с 1 по 5 (всего 5)
Просмотр 5 ответов — с 1 по 5 (всего 5)
  • Тема «проблема с отображением русских букв» закрыта для новых ответов.