I have problem with encoding on localhosot and remote server. For example when I choose russian langueage on localhost show me "вторник 14.07.15"(correct answer) but on remote server "Вторник 14.07.15". In lang.ru.php is UTF-8 encoding and file looks like this:
setlocale(LC_ALL, 'ru_RU.UTF-8', 'ru_RU', 'ru', 'rus', 'russian', 'ru_RU.ISO_8859-5', 'Russian_Russia.1251');
$lang = array();
$lang['code'] = "ru";
$lang['PAGE_TITLE'] = 'Hello';
In index.php I show date:
echo "<span class='daydatetime'>" . iconv('Windows-1250', 'UTF-8//TRANSLIT',strftime("%A <br> %d.%m.%y", strtotime("+ 1 days"))) . "</span>";
Why in localhost everything is all right and in remote server is broken encoding? I would be very grateful if someone help me. Best regards.
From php's setlocale page:
If locale is an array or followed by additional parameters then each array element or parameter is tried to be set as new locale until success.
Calling setlocale and providing a number of locales with different encodings (ru_RU.UTF-8, ru_RU.ISO_8859-5) may not match the expectation in the iconv() call:
string iconv (string $in_charset, string $out_charset, string $str)
that the $in_charset is Windows-1250. You can get the server encoding by
$in_charset = nl_langinfo(CODESET);
Also $out_charset should match the charset in the Content-Type header.