0
4

4 回答 4

2

Perhaps database uses different encoding than your PHP file. Start with comparing those strings converted with bin2hex() function (in PHP).

于 2012-06-01T11:44:32.833 回答
0

Second attempt:

There are a bunch of suggestions in the PHP doc's comments. Try these:

  1. http://www.php.net/manual/es/function.str-replace.php#106653
  2. http://www.php.net/manual/es/function.str-replace.php#75566
  3. http://www.php.net/manual/es/function.str-replace.php#72344

Try explicitly setting your page's chartype. Try placing this in the header:

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

Or, if you're using HTML 5:

<meta charset="utf-8">
于 2012-06-01T11:47:50.657 回答
-1

I think since you have some weird characters they might go beyond ascii range and you might need to use multibyte string functions, though it does not have str_replace analogue, you might need to use multibyte regexes.

于 2012-06-01T11:47:46.240 回答
-1

please take a look at this , it will tell you how to handle UTF characters in a web app

UTF-8 in Web Apps

于 2012-06-01T11:51:20.263 回答