Re: Expat on 64 bit Linux
Karl Waclawek <[email protected]> Fri, 05 Feb 2010 08:16:23 -0500
| Newsgroups | gmane.text.xml.expat.general |
|---|---|
| Message-ID | <[email protected]> |
On 04/02/2010 9:39 PM, Gabriel Becedillas wrote: > Hi, > I'm trying to use expat (the last version) on a 64 bit Linux (Intel). > Both XML_UNICODE_WCHAR_T and XML_UNICODE are defined, and > sizeof(wchar_t) == sizeof(XML_Char) == 4 bytes > I understand that when my callbacks get called, each XML_Char should > hold one character (at least that is the way it is working on a 32 bit > Windows). > Instead of that, what I'm getting is 2 characters in each XML_Char > element. Like if it was treating a 4 byte XML_Char array as a 2 byte > XML_Char array. > Can anyone help me with this ? > Thanks in advance. Expat reports back to the application in either UTF-8 or UTF-16 encoding. The options above generate UTF-16 output by Expat: - XML_UNICODE: defines XML_LChar as char and XML_Char as unsigned short, which means that even if the application itself works with 8bit strings, it can still generate UTF-16 encoded XML output - XML_UNICODE_WCHAR_T: defines XML_LChar and XML_Char as wchar_t The second one requires wchar_t to be 16bit wide, so that UTF-16 can be generated. Expat does not support UTF-32 output. You should check the -fshort-wchar option for compiling. Karl