> From: [EMAIL PROTECTED]
> Date: Sun, 5 Sep 2004 22:39:39 -0500 (CDT)
> Subject: Re: Storing foreign characters in DB
> 
> I am not using 3.xx versions anymore, but if I remember correctly they
> only allow a limited control for setting character sets.
> 
> In order to be able to give you any advice you need to be more specific.
> 
> Which character sets are set now for the server and the client as default ?
> Are the "foreign characters" in the same character set ?
> Are you attempting to store the "foreign character" together with your
> default characters in the same table / same DB ?
> 
> Nils Valentin - Tokyo/Japan

Nils, thanks for your response.

I've done some reading recommended by you and Rhino (this is all new to me),
and have some more specific questions now. First off, I am using MySQL
3.23.58 with the following setup:

character set: latin1
character sets: latin1 big5 cp1251 cp1257 croat czech danish dec8 dos
estonia euc_kr gb2312 gbk german1 greek hebrew hp8 hungarian koi8_ru
koi8_ukr latin2 latin5 swe7 usa7 win1250 win1251 win1251ukr ujis sjis tis620

Here's what I believe is happening: foreign characters entered into a form
input field on a website are transmitted to my PHP script with UTF-8
encoding. When this form data is stored in the database as-is, I'm seeing
the strange double-characters when I pull it back out of the database
because MySQL is set for Latin1 encoding, which is a subset of ISO-8859-1
(right?). 

So, I think what I need to do is convert the character encoding of the data
sent by the HTML form to ISO-8859-1 first *before* I store it in the
database. When I do that and then retrieve it, foreign characters display
properly. Fortunately, PHP has a character-encoding translation function
called "iconv()" which does exactly this.

Do I have this figured out correctly?

I suppose if I had a newer version of MySQL with Unicode support, I would be
able to store data from HTML forms directly without the translation. ?

I mostly just need to support foreign characters used in French, German and
Spanish mostly. So, I presume that Latin1 is all I need for now. Also, I'm
storing this data all in the same database.

Monty




-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to