Jump to content

Recommended Posts

hello guys, i'm new here, looking for some help..

here is the situation:
 
i'm using utf-8 to input japanese characters onto a database mysql, using php form, however while done from my PC it works perfectly and the script records the characters correctly onto the DB,  BUT on other PCs the script inputs raw symbols, i've declared completely all the things regarding the UTF-8 header, meta tag, etc. i'm sure this is not a php/sql issue, (because it works perfectly from one pc) but something from windows configuration i cannot understand.
 
anyone knows something regarding this issue?? 
 
thanks in advance
Link to comment
https://forums.phpfreaks.com/topic/290655-help-with-utf-8-stuff/
Share on other sites

What's a “raw symbol”?

 

Anyway, my guess is that you forgot to declare the character encoding of the database connection. In that case, MySQL will use the default encoding from the configuration which can differ accross systems.

 

How the encoding is declared depends on the database interface you use. If you're still using the ancient mysql_* functions, it's mysql_set_charset(). If you're using MySQLi, it's mysqli_set_charset(). If you're using PDO, it's the charset parameter of the DSN string.

 

Do not change the encoding with a SET NAMES query. While many people suggest this, it's very wrong, because it doesn't update the encoding information of the MySQL API and can break critical functions like mysql_real_escape_string().

This thread is more than a year old. Please don't revive it unless you have something important to add.

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.   Restore formatting

  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.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.