Welcome Guest, Not a member yet? Register   Sign In
Unable to include chinese characters in my sql strings
#1

(This post was last modified: 02-04-2015, 12:28 PM by GaryWJr. Edit Reason: Added information )

I have a field in SQL that contains Chinese characters. They work, and the site displays them correctly.

The issue is when I attempt to do a use a sql string that contains Chinese characters as part of the string to look for.

For example:
SELECT field WHERE field = "材料未到"

This becomes:
SELECT field WHERE field = "%E6%9D%90%E6%96%99%E6%9C%AA%E5%88%B0"

From the SQL server itself, the query works fine, so I know it isn't the way I have the table set up. Can anyone make any suggestions as to what I need to do to get this working? Thank you!

*Edit to add:*
The function calls another which queries the database. The function that is supposed to call the querying function is the one altering the string. This is forcing me to use a switch statement to change what it is passing along ( "%E6%9D%90%E6%96%99%E6%9C%AA%E5%88%B0") back to the Chinese characters it *should* be looking for ("材料未到") before it runs the query.

This seems like a less than ideal way of doing things (though it does seem to work), which is why I am hoping to find some suggestions on how to find a better fix. I've looked at the character sets being used, and everything says it is utf8 or utf-8
Reply




Theme © iAndrew 2016 - Forum software by © MyBB