Wons, Jean-Baptiste wrote:
Hello,

The fact that I hardcoded the Pound sign in this piece of code was just to show 
my problem.
In my program, I actualy get data from a file. Then I try to make a xml with 
the data embedded in this file.
That's a very important piece of information that you didn't mention in your original post.


Sometime, I have the pound sign in this file (this file is encoded in 
ISO-8859-1).
But the transcode method of XMLString get quite upset with that, and when I 
transcode the xml back to ISO-8859-1, I get the 0x1a.
XMLString::transcode() converts between UTF-16 and the local code page. Unless you can guarantee the local code page is ISO-8859-1, then don't use XMLString::transcode().


Is there any way to work-around this ?
If you know the encoding of the data, then you should just create a transcoder for that encoding. Take a look at XMLTransService::makeNewXMLTranscoder() in xercesc/util/TransService.hpp, and search through the code for examples of how to use it.

Dave

Reply via email to