If everything is unicode, which it seems from your message that it is, then you do not need any conversion. On Win32, XMLCh is UTF-16 little endian. The same is the case for all Win32 wide character string types. Hence no conversion is necessary. You should be okay for non-latin languages. The easiest way to test this would be to create an XML file which has some characters from far eastern languages (i.e. Japanese, Korean etc) and see if your app displays them okay. This will at least give you some validation of what you are doing.
 
Hope this helps.
 
Samar Lotia
-----Original Message-----
From: Gert van Spijker [mailto:[EMAIL PROTECTED]]
Sent: Friday, June 14, 2002 07:22
To: [EMAIL PROTECTED]
Subject: MFC- Unicode or ANSI

I have built an MFC 4.2 MDI application using MSVC 6.0. The app creates an IDOM tree for every MFC Document loaded. It works well; I initially used normal ansi strings in MFC but since Xerces internally uses Unicode, I decided to convert my MFC app to Unicode as well.
 
I did this yesterday and could got rid of most XMLString::transcode calls which simplifies the code. It still works well, but I have one doubt because I am not (yet) fully acquaintained with Unicode:
 
Both character sets use 16 bit unicode, but do I need to call a conversion function? I somewhere read in a code comment that you can use L() conversion method, which I do by using _T. Could I run into troubles when I change to non latin charset languages?
 
Gert

Reply via email to