writing subscripts in .plist files
I am trying to represent the number 2 as a subscript in a property list file. I tried using<sub>2</sub>
, but it doesn't seem to work. Can anyon开发者_C百科e help me with this? and will it be stored correctly in a string after I store it there?
A plist file is XML that follows a certain schema. <sub>
is not a valid tag in that schema. If you want to put that kind of stuff in the PList, you have to put in into CDATA:
<![CDATA[<sub>2</sub>]]>
A plist file is typically a UTF-8 encoded XML file. You should be able to use the Unicode subscript characters as it is. To copy a non-ASCII char, you can use the Keyboard & Character Viewer (on Lion: System Preferences > Language & Text > Input Sources > Select the Keyboard & Character Viewer as an input source).
精彩评论