php - ICONV encoding differs between localhost and remote server -
i have problem encoding on localhosot , remote server. example when choose russian langueage on localhost show me "вторник 14.07.15"(correct answer) on remote server "Вторник 14.07.15". in lang.ru.php utf-8 encoding , file looks 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 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 right , in remote server broken encoding? grateful if me. best regards.
from php's setlocale page:
if locale array or followed additional parameters each array element or parameter tried set new locale until success.
calling setlocale , providing number of locales different encodings (ru_ru.utf-8, ru_ru.iso_8859-5) may not match expectation in iconv() call:
string iconv (string $in_charset, string $out_charset, string $str)
that $in_charset windows-1250. can server encoding by
$in_charset = nl_langinfo(codeset);
also $out_charset should match charset in content-type header.
Comments
Post a Comment