Jump to content

Saving Japanese Characters to MySQL tables


gardan06

Recommended Posts

So we have a website that runs on ASP, PHP and mySQL and so far, the japanese text are working fine with meta charset set to "shift_jis". However, i need to call values from the database that are also japanese characters, and this is where my problems begin.

 

Firstly, i set collation to utf8, encoded the japanese text to utf8 then stored it in the database. i tried to decode it in the page that calls for that value, but it returns a different japanese text than the one i actually set, probably because meta charset is set to shift_jis. then, i set the column's collation to sjis, and tried to store the japanese text to the database, but it returns "????" and that was the the output on the actual page.

 

So im in a deep hole right now. I need to output the correct japanese text from the database to the page that calls it, but how would i do that?

 

Any kind of help is greatly appreciated. Thank you very much.

  • 2 weeks later...

Did you ever figure this out? I'm having this problem too.. I changed the database and table collation, but it still saves any character as "?"

 

*edit*

Well my problem was I needed to also change the column collation... (oops lol) So now I can save kanji to the database, but when I use a query to display it on a page, I'm getting question marks again (I think this was your problem?).. I'll keep looking..

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.