Hi Boris,
Thanks for the reply.

I am creating the XML file like :

char fileName[L_tmpnam];

tmpnam(fileName);

FILE * tempFile = fopen(fileName, "w+");

fwrite(xml.c_str(), 1, xml.length(), tempFile);

fclose(tempFile);


Where xml is a string which has xml contents. so by default it has Mac OS
Roman encoding.

I think this problem has to do with encoding only. When I change the
encoding of file to UTF-8 (by opening and saving in TextEdit on Mac with
different encoding) Xerces is able to parse it properly and converting the
string using the UTF-8 encoding solves the problem.

Now I am only looking for a way to create UTF-8 encoded file
programatically. I think I can do that by using Mac file creation APIs. just
wondering if there is a way to specify the encoding in standard C/C++ API
directly.

Thanks for your help.
Cheers!

On Mon, Dec 8, 2008 at 7:01 PM, Boris Kolpackov <[EMAIL PROTECTED]>wrote:

> Hi Dan,
>
> Dan Ribe <[EMAIL PROTECTED]> writes:
>
> > let me know if you need any other information from my side on this.
>
> Knowing the actual error that you get as well as the encoding
> specified in the XML document you are trying to parse would be
> helpful.
>
> Boris
>
> --
> Boris Kolpackov, Code Synthesis Tools
> http://codesynthesis.com/~boris/blog
> Open source XML data binding for C++:
> http://codesynthesis.com/products/xsd
> Mobile/embedded 
> <http://codesynthesis.com/products/xsdMobile/embedded>validating XML parsing:
> http://codesynthesis.com/products/xsde
>

Reply via email to