utf8 编码的网页中少数字符无法正确显示
在网页中正确显示`(急性)、(断线)等少数字符存在问题。大多数字符都正确显示,例如 β、ç 都正确显示。但我无法理解只有几个字符的问题。
我的数据库连接是utf8,我存储数据的列是utf8并且它被正确存储。我的html页面编码是utf8。
有人能解释一下吗?
编辑: 遇到麻烦的字符显示为 �。 另外,如果我使用像这样的 iconv 函数 iconv('UTF-8', 'UTF-8//IGNORE', $str);
它会删除该字符。
我还注意到的一件事是,根据此链接,未正确显示的字符都是 ISO-8859-1 符号 HTML ISO-8859-1 参考 谢谢。
There has been some problem showing few characters such as `(acute), ¦ (broken bar) properly in webpage. Most of the characters are shown properly like β, ç are shown properly. But I am fail to understand the problem with only few characters.
My database connection is utf8, the column I am storing data is utf8 and it's being stored properly. My html page encoding is utf8.
Can anyone shed some light on this?
Edit:
The troubled characters are shown as �.
Also if I use iconv function like this iconv('UTF-8', 'UTF-8//IGNORE', $str);
it removes the character.
Also one thing I noticed is that the characters not being shown up correctly are all ISO-8859-1 Symbols as per this link HTML ISO-8859-1 reference
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
尝试下面的代码并在获取数据时设置字符集('UTF-8','ISO-8859-1')
Try below code and set character set like ('UTF-8','ISO-8859-1') while fetching data
您是否尝试过在 HTML 中使用以下内容:
无论如何,似乎都可以在该网站上使用:
´
此
站点有更多信息:
http://www.fileformat.info/info/ unicode/char/search.htm
Have you tried using the following in your HTML:
Seems to work on this site in any case:
´
¦
This site has more information:
http://www.fileformat.info/info/unicode/char/search.htm