& or & what should be used for & (ampersan

2019-02-11 15:58发布

What is the difference between this & and this & for &(ampersand)? What should be use with utf8 ?

3条回答
The star\"
2楼-- · 2019-02-11 16:02

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 "&#38;"   -- ampersand, U+0026 ISOnum -->
查看更多
唯我独甜
3楼-- · 2019-02-11 16:05

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

查看更多
该账号已被封号
4楼-- · 2019-02-11 16:27

No difference. Utf-8 doesn't matter because & is reserved anyway. So use &amp;

查看更多
登录 后发表回答