gpt4 book ai didi

encoding - UTF编码之间的区别?

转载 作者:行者123 更新时间:2023-12-04 04:35:40 25 4
gpt4 key购买 nike

我有一个简单的问题-UTF-8UTF-16UTF-32有什么区别?我知道编码后的字符串的大小不同,但是UTF-16UTF-32的作用是什么?UTF-8是否能够正确处理所有语言? UTF-7如何适合呢?

编辑

好的,我相对理解整件事的技术方面,但是我仍然看不到为什么在我的应用程序中使用UTF-16而不是UTF-8的原因。所以我的问题是-除UTF-8外,其他编码的实际用法是什么?

最佳答案

著名的乔尔·斯波斯基(Joel Spolsky)的这篇文章很好地解释了它:
引用:

There are hundreds of traditional encodings which can only store some code points correctly and change all the other code points into question marks. Some popular encodings of English text are Windows-1252 (the Windows 9x standard for Western European languages) and ISO-8859-1, aka Latin-1 (also useful for any Western European language). But try to store Russian or Hebrew letters in these encodings and you get a bunch of question marks. UTF 7, 8, 16, and 32 all have the nice property of being able to store any code point correctly.

关于encoding - UTF编码之间的区别?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10970729/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com