diff --git a/ChangeLog b/ChangeLog index df596e54e..e3c93a53a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2003-01-27 Richard Frith-Macdonald + + * Source/Additions/Unicode.m: Fixed bug in utf-8 output for three + byte sequences. + * Tools/AGSOutput.m: Fix loss of trailing info after a closing + square bracket round a class name. + 2003-01-26 Richard Frith-Macdonald * Source/NSString.m: Added new MacOS-X method ... diff --git a/Source/Additions/GSXML.m b/Source/Additions/GSXML.m index bbd038328..1b17975a8 100644 --- a/Source/Additions/GSXML.m +++ b/Source/Additions/GSXML.m @@ -1978,7 +1978,10 @@ static NSString *endMarker = @"At end of incremental parse"; int newVal = (yesno == YES) ? 1 : 0; xmlGetFeature((xmlParserCtxtPtr)lib, "substitute entities", (void*)&oldVal); - xmlSetFeature((xmlParserCtxtPtr)lib, "substitute entities", (void*)&newVal); + if (xmlSetFeature((xmlParserCtxtPtr)lib, "substitute entities", + (void*)&newVal) < 0) + [NSException raise: NSInternalInconsistencyException + format: @"Unable to set substituteEntities"]; return (oldVal == 1) ? YES : NO; } diff --git a/Source/Additions/Unicode.m b/Source/Additions/Unicode.m index 49c0a9caa..0ff6a5793 100644 --- a/Source/Additions/Unicode.m +++ b/Source/Additions/Unicode.m @@ -1571,7 +1571,7 @@ GSFromUnicode(unsigned char **dst, unsigned int *size, const unichar *src, else { ptr[dpos++] = (u >> 12) | 0xe0; - ptr[dpos++] = (u >> 6) | 0x80; + ptr[dpos++] = ((u >> 6) & 0x3f) | 0x80; ptr[dpos++] = (u & 0x3f) | 0x80; } } diff --git a/Tools/AGSHtml.m b/Tools/AGSHtml.m index e62c543ef..782c04bcd 100644 --- a/Tools/AGSHtml.m +++ b/Tools/AGSHtml.m @@ -1989,7 +1989,9 @@ NSLog(@"Element '%@' not implemented", name); // FIXME { if ([node type] == XML_TEXT_NODE) { - [buf appendString: [node content]]; + NSString *str = [node content]; + + [buf appendString: str]; } else if ([node type] == XML_ENTITY_REF_NODE) { diff --git a/Tools/AGSOutput.m b/Tools/AGSOutput.m index d05732f86..324eadc26 100644 --- a/Tools/AGSOutput.m +++ b/Tools/AGSOutput.m @@ -2080,6 +2080,20 @@ static BOOL snuggleStart(NSString *t) cName, cName]; } [a replaceObjectAtIndex: l withObject: ref]; + if (ePos < [tmp length]) + { + NSString *end = [tmp substringFromIndex: ePos]; + + if ([end isEqualToString: @"]"] == NO + && [end hasPrefix: @"]"] == YES) + { + end = [end substringFromIndex: 1]; + } + if ([end length] > 0) + { + [a insertObject: end atIndex: ++l]; + } + } } } continue;