Forum Moderators: open

Message Too Old, No Replies

Japanese Table Text all Question Marks

How do you solve this?

         

neophyte

9:17 am on Sep 1, 2008 (gmt 0)

10+ Year Member



Hello All -

I'm interested in creating a utf-8 database that would handle english-language tables, japanese language-tables and german-language tables.

I've gotten pretty good a php, but I know very little about mysql databases - the projects that I've built so far have just been english language ones so I haven’t really need to go further than that until now.

I'm also using a mysql front-end called sqlyog v5.19 which has worked pretty well for me on past projects.

So, as a test I created a new DB with a table called “japanese”. I cut and pasted some japanese text into my "japanese" table to see what would happen... and I got a bunch of question marks. Then I went searching on the web for why this would be and apparently this is because the default character set for my db is set to DEFAULT CHARSET=latin1.

I went into my.ini and changed default-character-set=latin1 to default-character-set=utf8. I also did the same under the "Client" section of my.ini.

I saved the ini, closed it, restarted the server, and then using sqlyog, created a new sample db with one table. When I looked at the specs for the db, it shows a collation of latin1_swedish_ci (not utf8); when I look at the table specs, it shows: ENGINE=InnoDB DEFAULT CHARSET=latin1 (again, not utf8).

One thing is probably painfully obvious: I don't really know what I'm doing with this and am just hacking around to get this to work. I’m hoping that the good folks here could guide me through exactly what mysql setting I need to apply (and HOW to apply these changes) to ensure that all future dbs I create can handle multiple languages if needed.

If there's a good (and simple to understand "Step 1, 2, 3" kind of tutorial anyone knows about that would answer my questions please let me know.

General Info: According to my phpinfo() I’m running Apache server v2.2.3 and mysql v5.0.27.

Great appreciation in advance for all guidance!

Neophyte

[edited by: tedster at 3:40 pm (utc) on Sep. 1, 2008]

Anyango

9:32 am on Sep 1, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hey

Although this might be a very useless comment but there is one thing that i noticed.
It is pretty Simple to have multiple language support contrary to the common understanding. Recently i had to save German and French Characters in a MYSQL database and use them on a PHP site.
What i did was simple,
1) Database Charaterset=UTF-8
2) HTML content charset=UTF-8
3) and htmlentities() all the database values that were in german, before sending them to echo.

And it worked, i thought maybe it would require much more settings but it works, even without touching php.ini

Now, Interesting thing is that if i open my database in MYSQL section of webmin, it shows me those question mark characters that you have mentioned, but when the same data is shown on my site with htmlentities() it shows all the correct german and french characters. So maybe the admin that you are using for MYSQL that itself isnt supporting the new characterset and your Database is.

Sorry if it was a time wastage but For me it works Perfect.

[edited by: Anyango at 9:43 am (utc) on Sep. 1, 2008]

Anyango

9:44 am on Sep 1, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Sorry its htmlentities() not htmlencode() as i mistakenly typed earlier

phranque

10:08 am on Sep 1, 2008 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



the following threads may have helpful information for you:
[webmasterworld.com...]
[webmasterworld.com...]