2011-04-02 34 views
1

我使用Utf8 - 如何清理这些字符串?

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

Mysql数据库与 “utf8_general_ci”

,但我得到这些字符串

  • 鞍俱乐部3A上&德克;
  • SPECIALE阿尔Moro02/04/

如何清洗所有这些字符串?

+1

它看起来像在数据库? (例如从phpMyAdmin)?数据库中的“Saddle Club3ã â&de g;”是什么? – Wh1T3h4Ck5 2011-04-02 21:46:08

+1

你从哪里得到这些字符串使用什么?这需要更多信息。 – 2011-04-02 21:48:23

+0

“我得到这些字符串”在哪里,如何? – 2011-04-02 22:01:14

回答

0

对查询使用任何utf-8设置吗?

像:

mysql_query("SET CHARACTER SET utf8", $this->connection); 
mysql_query("SET NAMES utf8", $this->connection); 
$result = mysql_query($sql, $this->connection); 
1

你需要设置你的mysql数据库连接的编码。

$this->mysqli->query('SET NAMES utf8'); //on your mysqli instance 
or 
mysql_query('SET NAMES utf8'); // simple mysql query 

不知道,这可能有助于什么连接你使用的类型,但..