php - mysql chinese column -


to store chinese characters in mysql, recommended store them utf8 or ucs2? (i using char , varchar)

also, have seen utf8 uses 4 bytes of data store values. how many ucs2 use?

i have seen utf8 uses 4 bytes of data store values. how many ucs2 use?

utf-8 consists of variable length characters ranging 1 3 bytes, ucs2 (utf-16) fixed 2 bytes per character.

to store chinese characters in mysql, recommended store them utf8 or ucs2?

i have no experience chinese characters, top answer question answers basic question quite nicely: difference between utf-8 , utf-16?

from there:

most reasonable characters, latin, cyrillic, chinese, japanese can represented 2 bytes. unless exotic characters needed, means 16-bit subset of utf-16 can used fixed-length encoding, speeds indexing.

it seems chinese characters, ucs-2 tends save storage space. if web project, tend use utf-8 because more widespread encoding, , standard in web world. additional arguments utf-8 here: should utf-16 considered harmful?


mysql reference: 9.1.10. unicode support


Comments

Popular posts from this blog

java - SNMP4J General Variable Binding Error -

windows - Python Service Installation - "Could not find PythonClass entry" -

Determine if a XmlNode is empty or null in C#? -