[ expat-Patches-476931 ] Fix XML_UNICODE Support

noreply@sourceforge.net noreply@sourceforge.net
Tue Apr 23 14:10:08 2002


Patches item #476931, was opened at 2001-10-31 16:07
You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=310127&aid=476931&group_id=10127

Category: None
Group: None
>Status: Closed
>Resolution: Works For Me
Priority: 5
Submitted By: Karl Waclawek (kwaclaw)
Assigned to: Fred L. Drake, Jr. (fdrake)
Summary: Fix XML_UNICODE Support

Initial Comment:
The attached file fixes problems when compiling
with XML_UNICODE defined, which was not completely 
implemented. See bug #464837.

Apply this diff file to Expat.h in version 1.95.2
of Expat.

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

>Comment By: Karl Waclawek (kwaclaw)
Date: 2002-04-23 17:09

Message:
Logged In: YES 
user_id=290026

Fixed in expat.h rev. 1.16, xmlparse.c rev. 1.28.
Closed bug # 464837.

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

Comment By: Karl Waclawek (kwaclaw)
Date: 2002-04-18 23:32

Message:
Logged In: YES 
user_id=290026

I suggest that the following change is made to the patched
expat.h file:

Near the top of the file, the patch added these 12 lines:

#ifdef XML_UNICODE     /* Information is UTF-16 encoded. */
#  ifdef XML_UNICODE_WCHAR_T
typedef wchar_t XML_Char;
typedef wchar_t XML_LChar;
#  else
typedef unsigned short XML_Char;
typedef unsigned short XML_LChar;
#  endif
#else                  /* Information is UTF-8 encoded. */
typedef char XML_Char;
typedef char XML_LChar;
#endif

But I think it is better to have them like this
(I saw this in an earlier version of Expat, from
which it must have disappeared at one point):

#ifdef XML_UNICODE     /* Information is UTF-16 encoded. */
#  ifdef XML_UNICODE_WCHAR_T
typedef wchar_t XML_Char;
typedef wchar_t XML_LChar;
#  else
typedef unsigned short XML_Char;
typedef char XML_LChar;
#  endif
#else                  /* Information is UTF-8 encoded. */
typedef char XML_Char;
typedef char XML_LChar;
#endif


Karl


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

Comment By: Karl Waclawek (kwaclaw)
Date: 2001-10-31 16:09

Message:
Logged In: YES 
user_id=290026

To complete the fix, a patch for xmlparse.c has to be
added too. Same version requirements as before.

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

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