international character problem
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" />
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.
精彩评论