摘录显示 �而不是 ÆØÅ
可能是因为它读作
æ as &埃利格;
ø 作为 &奥斯斜杠;
å 作为 & aring;
http://img.lajlev.dk/ef75fcacb8ac88abb3aa93fd904335d2.png
如何让wordpress显示不要像 &osl 那样将其剪掉,这会导致 �
Probably becourse it read it as
æ as & aelig;
ø as & oslash;
å as & aring;
http://img.lajlev.dk/ef75fcacb8ac88abb3aa93fd904335d2.png
How do I make wordpress display æøå and not cut it of like &osl which results in �
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
看来你正在使用UTF-8(如果你查看源代码,你会看到&osl或与html输出中出现的相同的�?如果是后者,那么你正在使用utf-8(顺便说一句是什么)我总是推荐,所以一点也不坏)。utf
-8 的问题是它是一种多字节编码,这意味着某些字母使用超过 1 个字节的 PHP 函数来处理字符串,例如
substr()< /code> (这是获取一段更大字符串的函数,在本例中是完整文章文本的摘录),认为 1 个字符 = 1 个字节,因此 substr 在字节级别而不是字符级别工作
。不知道wordpress也不知道摘录机制是如何工作的,所以我不会告诉你任何解决方案(我有一些想法,但可能不是最好的,如果你不了解PHP那么它们只会让你感到困惑) 检查google
是否有
wordpress excerpt utf-8 substr
或其某些变体。It seems that you are using UTF-8 (if you view the source code, you see &osl or the same � that appears in the html output? If it's the latter, then you are using utf-8 (which btw is what I always recommend, so not bad at all).
The problem with utf-8 is that it is a multibyte encoding which means that some letters use more than 1 byte. PHP functions dealing with strings, such as
substr()
(which is the functions that gets a piece of a bigger string, in this case, the excerpt of the full article text), think that 1 character = 1 byte, so substr works at byte level, not character level.I don't know wordpress nor how the excerpt mechanism works, so I won't tell you any solution (I have a few ideas, but may not be the best, and if you don't know PHP then they will only confuse you).
Check google for
wordpress excerpt utf-8 substr
or some variation of it.