Special character is not displaying properly

﹥>﹥吖頭↗ 提交于 2019-12-10 19:22:01

问题


In a TextArea, I am using the ' character but it is not displaying properly. Instead, it is displaying something like this: –.

How do I get the ' character to display properly?


回答1:


You are probably not using the Ascii apostrophe (') but some non-Ascii punctuation mark, such as the correct punctuation apostrophe (’). The problem arises because your HTML document is (probably) UTF-8 encoded but the browser interprets it as windows-1252 encoded. If there encoding is not declared in HTTP headers, adding the tag <meta charset=utf-8> into the head part would help. For general advice on encodings, see the W3C page Character encodings.

The textarea element is meant for user input. For presenting your content, other elements (possibly styled with CSS) are usually a better choice. However, the encoding issue is the same.



来源:https://stackoverflow.com/questions/13468060/special-character-is-not-displaying-properly

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