utf-8 vs latin1

后端 未结 4 690
难免孤独
难免孤独 2020-12-25 14:28

What are the advantages/disadvantages between using utf8 as a charset against using latin1?

If utf can support more chars and is used consistently wouldn\'t it alway

4条回答
  •  感动是毒
    2020-12-25 15:17

    Fixed-length encodings such as latin-1 are always more efficient in terms of CPU consumption.

    If the set of tokens in some fixed-length character set is known to be sufficient for your purpose at hand, and your purpose involves heavy and intensive string processing, with lots of LENGTH() and SUBSTR() stuff, then that could be a good reason for not using encodings such as UTF-8.

    Oh, and BTW. Do not confuse, as you seem to do, between a character set and an encoding thereof. A character set is some defined set of writeable glyphs. The same character set can have multiple distinct encodings. The various versions of the unicode standard each constitute a character set. Each of them can be subjected to either UTF-8, UTF-16 and "UTF-32" (not an official name, but it refers to the idea of using full four bytes for any character) encoding, and the latter two can each come in a HOB-first or HOB-last flavour.

提交回复
热议问题