diff --git a/ChangeLog b/ChangeLog index aa416734f..513cf4d01 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,7 +1,7 @@ 2004-02-02 Richard Frith-Macdonald * Source/NSPropertyList.m: Integrate new parser to - NSPropertyListSerialisation + NSPropertyListSerialisation. Assume 8bit strings are utf8. 2004-02-04 01:10 Alexander Malmberg diff --git a/Source/NSPropertyList.m b/Source/NSPropertyList.m index 950cd59e5..fbea83961 100644 --- a/Source/NSPropertyList.m +++ b/Source/NSPropertyList.m @@ -2301,7 +2301,7 @@ OAppend(id obj, NSDictionary *loc, unsigned lev, unsigned step, unsigned char postfix[32]; // FIXME: Get more of the details - [data getBytes: postfix range: NSMakeRange(length-32, 32)]; + [plData getBytes: postfix range: NSMakeRange(length-32, 32)]; size = postfix[6]; if (size < 1 || size > 2) { @@ -2517,16 +2517,17 @@ OAppend(id obj, NSDictionary *loc, unsigned lev, unsigned step, { // Short string unsigned len = next - 0x50; - unsigned char buffer[len]; + unsigned char buffer[len+1]; [data getBytes: buffer range: NSMakeRange(counter, len)]; + buffer[len] = '\0'; if (mutability == NSPropertyListMutableContainersAndLeaves) { - result = [NSMutableString stringWithCString: buffer length: len]; + result = [NSMutableString stringWithUTF8String: buffer]; } else { - result = [NSString stringWithCString: buffer length: len]; + result = [NSString stringWithUTF8String: buffer]; } } else if (next == 0x5F)