ISO-8859-1 vs UTF-8?

前端 未结 5 1116
臣服心动
臣服心动 2020-12-12 20:25

What should be used and when ? or is it always better to use UTF-8 always? or ISO-8859-1 still has importance in specific conditions?

Is Character-set related to geo

5条回答
  •  没有蜡笔的小新
    2020-12-12 21:20

    • ISO-8859-1 is a great encoding to use when space is a premium and you are only ever going to want to encode characters from the basic latin languages it supports. And you are never ever ever going to ever have to ever contemplate ever upgrading your application to support non latin languages.

    • utf8 is a fantastic way to (a) use the large code base of 8bits per character code libraries there are that already exist, or (b) be a euro snob. utf8 encodes standard ascii in 1 byte per character, latin 1 in 2 bytes per character, eastern european and asian languages get 3 bytes per character. It possibly goes up to 4 bytes per character if you start trying to encode ancient languages that dont exist in the basic multilingual plane.

    • utf16 is a great way to start a new codebase from scratch. Its completely culture neutral - everone gets a fair handed 2 bytes per character. It does need 4 bytes per character for ancient/exotic languages - which means - in the worst case - its as bad as its big brother:

    • utf32 is a waste of space.

提交回复
热议问题