开发者

strange ? symbol in mysql post

Whenever I put ñ in a mysql row... it $_POST's it as开发者_如何学运维 a strange triangular ? symbol...

Anyone know what the problem is?


First thing is to check if your mysql column is has the correct encoding (utf8 probably).

Then you may need to enable utf8 when connecting to mysql, at least that's what I must do in Perl.

This link might help http://dreweyscorner.blogspot.com/2008/01/enable-utf-8-on-php-mysql-and-apache.html


It's a mismatch between the encoding used to store the accented character in the database and the charset used by the page that displays it. The text was probably stored as ISO-8859-1 (Western European), but is being displayed as Unicode (UTF-8).

Make sure that the insert form and the display page both use the same encoding. These days, both should have the following tag in the of the page:

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

Unless you're using an obsolete version of MySQL (such as 3.23), it should support UTF-8 encoding by default.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜