Framework "kohana",
“bootstrap.php” is set to “setlocale (LC_ALL, 'en_US.utf-8');”
In the controller, I want to get the day of the week (letters)

setlocale(LC_TIME, 'rus_RUS'); $date = '2013-01-01'; $utf8 = strftime("%A, %d/%m/%Y", strtotime($date)); echo"utf8 = $utf8"; 

displays:

 utf8 =        , 01/01/2013 

the function returns the result in "win1251"
had to:

 $textwin1251 = iconv('windows-1251', 'UTF-8', $ut8); echo $textwin1251; 

displays "Tuesday" - everything is OK.
Question :
Is it possible to do without “iconv” somehow? Otherwise, tormented by a vague doubt that something here is not clean.

  • In HTML meta tags, specify the encoding. - Andrey Talanin
  • I tried, then the rest of the text is converted into "abru-codabra" - Konstantin78
  • I suppose this is because the files themselves are encoded in win-1251. If you recode them to utf-8, the problem is solved. When you create a project, you need to carefully check that everything was in utf-8 - Andrey Talanin

0