What are some common ways that smart quotes will be incorrectly encoded?

我怕爱的太早我们不能终老 提交于 2020-01-02 07:07:10

问题


Smart quotes cause problems when they are saved in one encoding and then rendered/viewed using a different encoding. What are some ways that smart quotes will appear when rendered incorrectly?

I'm trying to solve the problem where you see an incorrect character encoding and can then say, "Oh, those should be smart quotes."


回答1:


The most common encoding mixup is probably UTF-8 versus ANSI/Latin1.

The ANSI/Latin1 encoding of “ ‘ ’ ” is [93] [91] [92] [94] hexadecimal. If interpreted as UTF-8, these bytes will most likely be treated as invalid characters and may appear as boxed question marks.

The UTF-8 encoding of “ ‘ ’ ” is [E2 80 9C] [E2 80 98] [E2 80 99] [E2 80 9D] hexadecimal. If interpreted as ANSI/Latin1, these bytes will appear as “ ‘ ’ â€.



来源:https://stackoverflow.com/questions/9282364/what-are-some-common-ways-that-smart-quotes-will-be-incorrectly-encoded

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!