Re: how to store chinese char in mysql database?


[ Follow Ups ] [ Post Followup ] [ Chinese Computing Discussion List ]

Posted by seba on May 20, 2002 at 10:13:12:

In Reply to: how to store chinese char in mysql database? posted by manu on May 19, 2002 at 11:08:34:

This is taken from the website
http://www.mysql.com/doc/c/o/configure_options.html

By default, MySQL uses the ISO-8859-1 (Latin1) character set. To change the default set, use the --with-charset option:
shell> ./configure --with-charset=CHARSET
CHARSET may be one of big5, cp1251, cp1257, czech, danish, dec8, dos, euc_kr, gb2312, gbk, german1, hebrew, hp8, hungarian, koi8_ru, koi8_ukr, latin1, latin2, sjis, swe7, tis620, ujis, usa7, or win1251ukr. See section 4.6.1 The Character Set Used for Data and Sorting. If you want to convert characters between the server and the client, you should take a look at the SET OPTION CHARACTER SET command. See section 5.5.6 SET Syntax. Warning: If you change character sets after having created any tables, you will have to run myisamchk -r -q on every table. Your indexes may be sorted incorrectly otherwise. (This can happen if you install MySQL, create some tables, then reconfigure MySQL to use a different character set and reinstall it.) With the option --with-extra-charset=LIST you can define which additional character sets should be compiled into the server. Here LIST is either a list of character sets separated with spaces, complex to include all characters that can't be dynamically loaded, or all to include all character sets into the binaries.

also read : http://www.mysql.com/doc/C/h/Character_sets.html

and i found also this:
If you are using Chinese data in the so-called big5 encoding, you want to make all character columns BINARY. This works because the sorting order of big5 encoding characters is based on the order of ASCII codes.

To input Chinese characters just use your favorite FEP or IME, just make sure that your encoding is set right.



Follow Ups:



Post a Followup

Name:
E-Mail:

Subject:

Comments:

Optional Link URL:
Link Title:
Optional Image URL:


[ Follow Ups ] [ Post Followup ] [ Chinese Computing Discussion List ]