Unicode string in XML

前端 未结 2 1737
眼角桃花
眼角桃花 2020-12-15 22:07

In xml unicode are represented as follows:

e.g:

\\ue349 

What if I want to write a string consists of two chars with unicodes e343

相关标签:
2条回答
  • 2020-12-15 22:32

    <node>&#xE343;&#xE312;</node>

    0 讨论(0)
  • 2020-12-15 22:38

    XML does not use \ue349 notation. Character references, starting with &#, may be used, but they are mostly not needed. XML is usually used with UTF-8 character encoding, so that each character can be written as such. (When generating XML in a program, you might well use a notation like \ue349 if supported by the programming language.)

    In Unicode, the numbers E343 and E312 refer to Private Use codepoints, to which no character is assigned by the standard. They may be used by private agreements as desired, but you should not expect any software or any person to understand them, except by such agreements. With this in mind, the code points U+E343 U+E312 (and hence the characters they may denote by some agreement) can be written as &#xe343;&#xe312;.

    0 讨论(0)
提交回复
热议问题