What Character Encoding is best for multinational companies

后端 未结 3 1150
予麋鹿
予麋鹿 2021-02-07 07:36

If you had a website that was to be translated into every language in the world and therefore had a database with all these translations what character encoding would be best? U

3条回答
  •  忘掉有多难
    2021-02-07 08:08

    You need to take more into consideration when dealing with this. For instance you can represent chinese, japanese and pretty much everything in UTF-8 -- but it will use a set of escape characters for each such "foreign" character -- and as such your data representation might take a lot of storage due to these extra markers. You could look at UTF-16 as well which doesn't need escape/markers for the likes of chinese, japanese and so on -- however, each character takes now 2 bytes to represent; so if you're dealing mainly with Latin charsets you've just doubled the size of your data storage with no benefit. There's also shift-jis dedicated for Japanese which represents these charset better than UTF-8 or UTF-16 but then you don't have support for Latin chars. I would say, if you know upfront you will have a lot of foreign characters, consider UTF-16; if you're mainly dealing with accents and Latin chars, use UTF-8; if you won't be using any Latin characters then consider shift-jis and the likes.

提交回复
热议问题