retrieving special characters from mysql database,

2019-05-22 23:54发布

问题:

I've inserted some data to a mysql database. Set up the utf-8 cz. And it looks fine.

But when I echo a row from the table, special characters are not shown. Meta utf-8 included.

Any ideas how to fix it? Thank you

回答1:

use

mysql_set_charset('utf8');

before you execute the query in PHP



回答2:

add this too your too to ensure browser's read your page with the right encoding:

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