What's the point of UTF-16?

前端 未结 5 916
太阳男子
太阳男子 2021-01-31 01:29

I\'ve never understood the point of UTF-16 encoding. If you need to be able to treat strings as random access (i.e. a code point is the same as a code unit) then you need UTF-3

5条回答
  •  轮回少年
    2021-01-31 01:50

    UTF16 is generally used as a direct mapping to multi-byte character sets, ie onyl the original 0-0xFFFF assigned characters.

    This gives you the best of both worlds, you have fixed character size but can still print all the characters anyone is likely to use (orthodox Klingon religous scripts excepted)

提交回复
热议问题