Diamonds with question marks

自作多情 提交于 2021-02-04 18:58:07

问题


I'm getting these little diamonds with question marks in them in my HTML attributes when I present data from my database. I'm using EPiServer and a few custom properties.

This is the information I've gathered,

  • I save my data as a XML document, since I use custom EPiServer properties which need more than one defined value. This is saved as UTF8.

  • It's only attributes in element tags which have this problem, such as align=left becomes align=�left�. There is no " character there, but I get the diamonds anyway.

  • If I use " outside an element, it works and shows correctly.

Any clues?


回答1:


This is a problem with your character encoding scheme.

I would recommend reading this article, where (close to the bottom of it), he shows you why you get that little diamond with question marks.




回答2:


Has the XML been touched by any of the Microsoft Office suite products.

These are notorius for switching vanilla quotes (") x'22' to smartquotes x'93' and x'94'(“”).

Also singlequote (') is often converted from x'27' to x'91' and x'92' pairs (‘’).



来源:https://stackoverflow.com/questions/2809355/diamonds-with-question-marks

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