When to Use Character Codes
Posted: Fri Jul 22, 2011 9:50 pm
I'm pretty new to XML and coding generally, but picking it up quickly.
One question I can't seem to figure out is when I should use character codes for characters (such as — for em-dash) instead of using the character itself in the XML.
For example, if I paste in content from Word to a DocBook page in Author View, my em-dashes and curly quote marks all look fine in both Author & Text view. Should I replace them with the appropriate codes in text view? Or leave them?
I'm working in DocBook documents with encoding="UTF-8" and I'm outputting the XML content as PDF, HTML, and ePub, and I think the output looks the same whether I used character codes or the original characters pasted in from Word. I'm publishing work for consumers, so it is important to have appropriate curly quotes, etc.
Can someone point me to a layman resource or give me a quick rundown on this issue? Right now I'm searching out single and double quotes, em-dash, en-dash, and ellipsis. Are there other characters I should be replacing with code? Am I wasting my time?
Any help is appreciated.
One question I can't seem to figure out is when I should use character codes for characters (such as — for em-dash) instead of using the character itself in the XML.
For example, if I paste in content from Word to a DocBook page in Author View, my em-dashes and curly quote marks all look fine in both Author & Text view. Should I replace them with the appropriate codes in text view? Or leave them?
I'm working in DocBook documents with encoding="UTF-8" and I'm outputting the XML content as PDF, HTML, and ePub, and I think the output looks the same whether I used character codes or the original characters pasted in from Word. I'm publishing work for consumers, so it is important to have appropriate curly quotes, etc.
Can someone point me to a layman resource or give me a quick rundown on this issue? Right now I'm searching out single and double quotes, em-dash, en-dash, and ellipsis. Are there other characters I should be replacing with code? Am I wasting my time?
Any help is appreciated.