mySQL database chinese characters get represented as?
I set up a database using the default collation "latin_swedish_ci" - but the database is being used mostly in China - what collation type should I use? Is there anything else I need to change about the database or the form itself? Right now, I'm seeing a lot of fields in the database that are represented by ?? marks. Also, can I change the collation type on the fly or do I need to backup all existing da开发者_开发百科ta before switching over. Thanks!
I would recommend "utf16" if you are storing a lot of Chinese characters. This will store all the characters you are likely to encounter in two bytes (including boring old ASCII chars!).
This is better than utf8 for this type of data as common ideograms consume three or four bytes of storage and often require a complex conversion to utf16/32 before they can be used within a program.
精彩评论