What is the difference between this &
and this &
for &(ampersand)? What should be use with utf8 ?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
Both are character references and refer to the same character (AMPERSAND, U+0026). &
is a named or entity character reference and &
is a numerical character reference.
In fact, &
is actually just a substitution for &
(see list of character entities):
<!ENTITY amp CDATA "&" -- ampersand, U+0026 ISOnum -->
回答2:
http://www.xml.com/pub/a/2001/01/31/qanda.html
According to O'Reilly you should be using & in xml. UTF-8 is quite a bit different. http://www.fileformat.info/info/unicode/char/0026/index.htm
回答3:
No difference. Utf-8 doesn't matter because & is reserved anyway. So use &