[Expat-bugs] [ expat-Bugs-931546 ] Unixode support for Windows and
Unix are not compatible
SourceForge.net
noreply at sourceforge.net
Thu Apr 8 02:45:18 EDT 2004
Bugs item #931546, was opened at 2004-04-08 09:45
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=110127&aid=931546&group_id=10127
Category: None
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Arthur Prosso (turik)
Assigned to: Nobody/Anonymous (nobody)
Summary: Unixode support for Windows and Unix are not compatible
Initial Comment:
This bug or "feauture" exists in 1.95.6 and also 1.95.7
versions (I have not tested the previous ones).
There is inconsistency between the Unicode support on
Unix and on Windows.
On windows wchar_t is defined as unsighed short. On
most Unix platforms it is defined as unsigned int
If expat is compiled with XML_UNICODE_WCHAR_T
switch, then XML_Char is defined as wchar_t, but ICHAR
type is hardcoded as unsigned short for UNIX (see
xmparse.c). As e result, every in XmlConvert() every
two unsigned short characters are packed into one
wchar_t character. Is it "BY DESIGN" ???
But the OnElementStart(XML_Char*), OnElementEnd
(XML_Char*) handlers assume a regular wchar_t
character.
As a result, the code written on Windows is not UNIX
compatible.
The same problem occurs, when encoding ("UTF-16") is
used. Before Calling XML_Parse on UNIX, the input buffer
of type wchar_t* must be manually converted to
unsigned short* to make things work
Please, explain this behaviour. Is it a "bug" or "by
design" ?
Thank you
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=110127&aid=931546&group_id=10127
More information about the Expat-bugs
mailing list