[Expat-bugs] [ expat-Bugs-1023646 ] Error in codepageMap, codepage.c

SourceForge.net noreply at sourceforge.net
Thu Jan 27 06:44:02 CET 2005


Bugs item #1023646, was opened at 2004-09-07 08:39
Message generated for change (Comment added) made by fdrake
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=110127&aid=1023646&group_id=10127

Category: None
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Nobody/Anonymous (nobody)
Assigned to: Nobody/Anonymous (nobody)
Summary: Error in codepageMap, codepage.c

Initial Comment:
Applies to expat v.1.95.8

>From MS:

"LeadByte:
Specifies a fixed-length array of lead-byte ranges, 
where the number of lead-byte ranges is variable. If 
there are no lead bytes in this code page, then every 
element of the array is NULL. If there are lead bytes in 
this code page, a starting value and ending value is 
specified for each range. Ranges are inclusive. The 
maximum number of lead-byte ranges for any code page 
is five. The array uses two bytes to describe each 
range, with a double-byte null terminator after the last 
range."

Note that "Ranges are inclusive". Therefore the function 
codepageMap should be changed:

for (i = 0; i < MAX_LEADBYTES; i+=2) 
{
  int j, lim;
  if (info.LeadByte[i] == 0 && info.LeadByte[i + 1] == 0) 
    break;
  lim = info.LeadByte[i + 1];
  for (j = info.LeadByte[i]; j <= lim; j++) map[j] = -2;
}

Regards,
Ole Stauning, spam at uning.dk


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

>Comment By: Fred L. Drake, Jr. (fdrake)
Date: 2005-01-27 00:44

Message:
Logged In: YES 
user_id=3066

I'm inclined to agree, having read the CPINFO 
documentation.  Do you have a test case that breaks using 
the current code, and which your proposed change would 
fix? 

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

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=110127&aid=1023646&group_id=10127


More information about the Expat-bugs mailing list