开发者

international character problem

开发者 https://www.devze.com 2023-02-11 00:58 出处:网络
even though php page\'s header set to UTF-8 i get this error开发者_C百科 here is meta tag <meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />

even though php page's header set to UTF-8 i get this error

开发者_C百科

international character problem

here is meta tag

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

text is coming from php gettext.

how can i solve this ?

thanks


The output is probably encoded in ISO-8859-1 when it came from gettext. While you could manually convert it with utf8_encode(), there is a builtin feature for gettext which should do that automatically.

See the user comment here: http://www.php.net/manual/en/function.bind-textdomain-codeset.php#67200

In your case you would need:

bind_textdomain_codeset($domain, "UTF-8");

Obviously it would be best if your gettext .mo files were encoded in UTF-8 too.

If that doesn't help yet, try overriding the locale with setlocale("de_DE.UTF-8") or maybe putenv("LC_MESSAGES", "de_DE.UTF-8") and LANG= or similar.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号