[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: How can I preserve ASCII Encoding Character Sets?
At 2012-11-06 16:54 -0500, Philip Vallone wrote:
I want to preserve   or   as   or  .
Currently, as an example,   will output into my resulting file as a space, Actually, it is a non-breaking space (NBSP) and not a space. but when the resulting xsl file is used to transform the xml file to FO it prints out a bad character "E".
I have nailed down the issue to when I convert my stylesheet into one.
I hope this explains my issue. I appreciate all the help.
If you use Java or some other programming language, which isn't native XML, then it is likely there that the problems are being introduced with the character set. Reading the evidence you provide here, you are using an XML processor in another language to read the stylesheet, that processor is converting the numeric character reference into a Unicode character, your language is writing out the Unicode character as UTF-8, thus losing the markup of the numeric character reference, and the resulting file still says "US-ASCII" at the top while the string is encoded in UTF-8. I suggest you use XSLT to aggregate your stylesheet fragments into a single stylesheet (which is what I do in the obfuscation post I made earlier), thus your end result will be in UTF-8, but the declaration at the top will indicate UTF-8. You will lose the numeric character reference as it will be replaced by the Unicode character, but this is fine because the declaration at the top of your output will indicate or imply UTF-8. Then treat the aggregated stylesheet in your encrypt/decrypt process as an octet stream, not as a string of characters, thus avoiding any interpretation of UTF-8 on the way in or out. Or use strings if you can guarantee fidelity between your input and your output. This should get around your characters being UTF-8 and your declaration being ASCII. I hope this helps. . . . . . . . . . . . . Ken
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|