Yahoo Answers is shutting down on May 4th, 2021 (Eastern Time) and beginning April 20th, 2021 (Eastern Time) the Yahoo Answers website will be in read-only mode. There will be no changes to other Yahoo properties or services, or your Yahoo account. You can find more information about the Yahoo Answers shutdown and how to download your data on this help page.
Trending News
Accessing Japanese encoded words in mySQL with PHP?
I'm running an apache web server with PHP support and I'm using mySQL as a database. I want to store Japanese words in the database (using UTF-8 encoding) and then be able to display them via a PHP database call.
I can get my computer to display Japanese characters. I've even added the Japanese words to the database. (I can see them using phpMyAdmin.) However, when I run a database call from my PHP page, I only get question marks instead of the Japanese characters.
How can I get these characters to display correctly?
It actually ended up being a problem with mySQL. I needed to add this line:
mysql_query("SET CHARACTER SET 'utf8'");
That made it work.
2 Answers
- Manzana verdeLv 51 decade agoFavorite Answer
mm.. I assume you have install al Asian Language in your windows.
so the problem is, you can't get Japanese words correctly from your database.
I Use Delphi to build some program, UTF-8 is widechar, but my Delphi always 'think' UTF-8 is string, not widechar, so.. in the past time, i'll always get same problem too until I build a component for my Delphi which can get UTF-8 as widechar.
I don't know about PHP, but you can check if your PHP get a widechar or just a string, 16 bit or 32 bit char.
Hope this can solve your problem
- 1 decade ago
Check if the encoding of the php page is set correctly
u have to set this in every page, u can also check by manually changing the Page encoding under the View menu of IE.