
May 8th, 2008, 06:40 PM
|
|
Registered User
|
|
Join Date: May 2008
Posts: 1
Time spent in forums: 14 m 28 sec
Reputation Power: 0
|
|
|
Chinese characters treated as string-escape commands
This is most unusual, and has stumped me for a long time now. I have been working with Chinese characters using PHP/MySQL for some time now. However, for whatever reason, this time I cannot seem to properly input the Chinese data. I have tried echo()ing the MySQL query in PHP and executing the query in a MySQL administration tool by copy and pasting, and it works fine. However, I have also tried hard-coding the Chinese in the php query statement (rather than passing them with a php variable) and that ALSO works fine. This leads me to suspect that somehow the PHP variable is encoded differently than how the MySQL DB wants the variable, which is leading the output to look fine, but the query to fail internally. That's my best guess.
Further checking reveals that the variable containing Chinese (which, again, can be printed to the screen fine) is being treated as an escape sequence of some sort my MySQL. That is to say, if I append some English to the front and back of the Chinese statement and run an update query with THAT variable, the result in the database is ONLY the "front" English - no Chinese or "back" english.
Unfortunately, I have no freaking clue how to fix this. Can anyone help?
|