为什么RSS不能处理&符号? [英] Why can't RSS handle the ampersand?
问题描述
当我遇到一个破碎的RSS提要时,通常的原因是由于第23行说Sanford& Sons。
When I come across a broken RSS feed, the usual reason its all blown to pieces is because line 23 says "Sanford & Sons."
最令人困惑的是,如果将&
转换为& ; amp;
,一切都很好,即使你的替代方案仍然包含问题字符。
The most confusing thing is the fact that if you convert the &
into &
, all is well, even though your alternative still contains the problem character.
为什么RSS不能渲染&符号(&
)字符默认情况下
Why does RSS fail at rendering the ampersand (&
) character by default?
推荐答案
;看到,翻译正在寻找一个有效的逃脱&序列(例如'& amp;'
)。当找到无效的序列时,会引发错误。这就是它的一切。
When a 'raw' & is seen, the interpreter is looking for one of the valid escaped & sequences (such as '&'
). When an invalid sequence is found it throws an error. That's all there is to it.
这篇关于为什么RSS不能处理&符号?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!