Help with mysql and foreign characters

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
tehhparadox
Forum Newbie
Posts: 18
Joined: Thu Oct 01, 2009 11:55 am

Help with mysql and foreign characters

Post by tehhparadox »

Hi guys

I am making something that involves putting and getting korean characters into a mysql database and I came across a problem. When you insert some korean characters, they all change into some strange symbols like '����'. I thought it might be fine once I get and display it on a html page, but it turned into some other strange symbols and you can't read them whatsoever.
I changed the Collation in my tables to different character sets including utf-8_unicode_ci, euckr_bin and euckr_korean_ci, but that didn't help either. What do I have to do to make my database allow foreigh character sets to be transferred safely?
User avatar
Apollo
Forum Regular
Posts: 794
Joined: Wed Apr 30, 2008 2:34 am

Re: Help with mysql and foreign characters

Post by Apollo »

tehhparadox wrote:What do I have to do to make my database allow foreigh character sets to be transferred safely?
Use the same encoding everywhere (i.e. on your database collations and connection, and in your html header), and make sure that the text you're putting your DB is actually encoded that way.
tehhparadox
Forum Newbie
Posts: 18
Joined: Thu Oct 01, 2009 11:55 am

Re: Help with mysql and foreign characters

Post by tehhparadox »

Even if I change encoding in Firefox (View->Encoding) none of them work..
User avatar
Apollo
Forum Regular
Posts: 794
Joined: Wed Apr 30, 2008 2:34 am

Re: Help with mysql and foreign characters

Post by Apollo »

Randomly changing codepages here and there won't solve the problem. Really, if you follow the rule I mentioned above, it will work. Always.
Post Reply