Jump to content
Sign in to follow this  
ala888

mysql htmlspecialchars(chinese) vs internal php htmlspecial chars

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

Share this post


Link to post
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).

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...