Jump to content

mysql htmlspecialchars(chinese) vs internal php htmlspecial chars


ala888

Recommended Posts

6UkTro3.png

 

 

 

 

so chinese characters generated internally in php, and also via user input display fine. but ones in the mysql server cant be displayed at all with htmlspecialchars. It should also be noted that the LIKE command in mysql also does not work with chinese/japanese/korean

Edited by ala888
Link to comment
Share on other sites

I'm not sure what I'm looking at in that picture, but you basically just need to make sure that everything (the database collation, meta tag/HTTP headers, file format, etc) are all UTF. I typically haven't used htmlspecialchars to print other languages, I just output the strings directly (either directly on a page, or encoded as a JSON structure, sent to Javascript, and then added somewhere).

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...