14,954
edits
| Line 2: | Line 2: | ||
# Possible cause | # Possible cause | ||
#* Encoding issue: Choose the correct the language/encode of message text or auto detect the encode by tools | #* Encoding issue: Choose the correct the language/encode of message text or auto detect the encode by tools | ||
#* PHP [http://php.net/manual/en/function.utf8-encode.php utf8_encode()] & [http://php.net/manual/en/function.utf8-decode.php utf8_decode()] | #* PHP [http://php.net/manual/en/function.utf8-encode.php utf8_encode()] & [http://php.net/manual/en/function.utf8-decode.php utf8_decode()] | ||
# (optional) convert the current encode to UTF-8 | # (optional) convert the current encode to UTF-8 | ||
# (optional) Making text wrap to window size | # (optional) Making text wrap to window size | ||
<table border="1"> | |||
<tr> | |||
<th width="40%"> Case | |||
</th> | |||
<th width="40%"> Is Chinese text garbled/encoded? | |||
</th> | |||
<th width="20%"> Sample text | |||
</th> | |||
</tr> | |||
<tr> | |||
<th> [http://www.w3schools.com/jsref/jsref_decodeuricomponent.asp JavaScript decodeURIComponent() Function]<ref>[http://stackoverflow.com/questions/9901027/how-to-encode-url-contains-unicode-characters-with-php urlencode - How to Encode URL Contains Unicode Characters with PHP - Stack Overflow]</ref> | |||
</th> | |||
<td> TRUE | |||
</td> | |||
<td> <ul><li>before: http://www.中文網址.tw/my test.asp?name=ståle&car=saab <li>after: http%3A%2F%2Fwww.%E4%B8%AD%E6%96%87%E7%B6%B2%E5%9D%80.tw%2Fmy%20test.asp%3Fname%3Dst%C3%A5le%26car%3Dsaab </ul> | |||
</td> | |||
</tr> | |||
<tr> | |||
<th> [http://meyerweb.com/eric/tools/dencoder/ URL Decoder/Encoder]<ref>PHP [http://php.net/manual/en/function.urlencode.php urlencode()]</ref> | |||
</th> | |||
<td> TRUE | |||
</td> | |||
<td> <ul><li>before: http://www.中文網址.tw <li>after: http%3A%2F%2Fwww.%E4%B8%AD%E6%96%87%E7%B6%B2%E5%9D%80.tw</ul> | |||
</td> | |||
</tr> | |||
<tr> | |||
<th> [http://php.net/serialize PHP: serialize - Manual] | |||
</th> | |||
<td> FALSE | |||
</td> | |||
<td> <ul><li>before: array("作者" => "馬克吐溫"); <li>a:1:{s:6:"作者";s:12:"馬克吐溫";}</ul> | |||
</td> | |||
</tr> | |||
</table> | |||
== Ways to fix garbled message text == | == Ways to fix garbled message text == | ||