[ expat-Patches-546795 ] XML_UNICODE: Improvement on patch 476931

noreply@sourceforge.net noreply@sourceforge.net
Sun Apr 21 09:35:04 2002


Patches item #546795, was opened at 2002-04-21 12:34
You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=310127&aid=546795&group_id=10127

Category: None
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Karl Waclawek (kwaclaw)
Assigned to: Nobody/Anonymous (nobody)
Summary: XML_UNICODE: Improvement on patch 476931

Initial Comment:
The previous patch would not work when XML_UNICODE
was defined, but not XML_UNICODE_WCHAR_T.
However, since wchar_t in some Unix systems
is 4 bytes long, it is desirable to have Expat
work when XML_Char is defined as unsigned short,
(for 16bit unicode).

To achieve this, I had to split up the XML_T macro
into two macros, XML_T for XML output, and XML_L
for message strings. This makes the behaviour different
between these two cases:

1) XML_UNICODE defined, but not XML_UNICODE_WCHAR_T:
   - XML output treated as unsigned short arrays
   - message strings treated as char arrays
2) Both defined, XML_UNICODE and XML_UNICODE_WCHAR_T:
   - XML output treated as wchar_t arrays
   - message strings treated as wchar_t arrays

Two files are affected, expat.h and xmlparse.c.
The modifications are based on the following CVS
revisions:
- expat.h rev. 1.14
- xmlparse.c rev. 1.26
These files also contain the XML_SetReturnNSTriplet
fixes from patch #546540.

This obviously needs some more testing, preferably
with files containing lots of Unicode characters
outside the normal range.

I have attached two versions of each file, with,
or without annotations (which are marked with "//kw").

Karl

----------------------------------------------------------------------

You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=310127&aid=546795&group_id=10127