mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-31 00:30:53 +00:00
* Source/NSString.m (-initWithCoder:): In keyed coding the key
"NS.bytes" may contain either an NSData or an NSString object. Not sure about the encoding, I am using UTF8. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@34010 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
a6a481bead
commit
e6a75007c0
2 changed files with 31 additions and 11 deletions
|
@ -1,3 +1,9 @@
|
||||||
|
2011-10-17 Fred Kiefer <FredKiefer@gmx.de>
|
||||||
|
|
||||||
|
* Source/NSString.m (-initWithCoder:): In keyed coding the key
|
||||||
|
"NS.bytes" may contain either an NSData or an NSString object. Not
|
||||||
|
sure about the encoding, I am using UTF8.
|
||||||
|
|
||||||
2011-10-17 Richard Frith-Macdonald <rfm@gnu.org>
|
2011-10-17 Richard Frith-Macdonald <rfm@gnu.org>
|
||||||
|
|
||||||
* standalone.conf: First draft at a layout for standalone system
|
* standalone.conf: First draft at a layout for standalone system
|
||||||
|
@ -16,7 +22,7 @@
|
||||||
|
|
||||||
2011-10-15 Gregory Casamento <greg.casamento@gmail.com>
|
2011-10-15 Gregory Casamento <greg.casamento@gmail.com>
|
||||||
|
|
||||||
* Documentation/GNUmakefile:
|
* Documentation/GNUmakefile:
|
||||||
* Documentation/README.initialize: Documentation referred to by
|
* Documentation/README.initialize: Documentation referred to by
|
||||||
NSThread warning.
|
NSThread warning.
|
||||||
|
|
||||||
|
|
|
@ -5036,20 +5036,34 @@ static NSFileManager *fm = nil;
|
||||||
{
|
{
|
||||||
if ([aCoder allowsKeyedCoding])
|
if ([aCoder allowsKeyedCoding])
|
||||||
{
|
{
|
||||||
NSString *string = nil;
|
|
||||||
|
|
||||||
if ([aCoder containsValueForKey: @"NS.string"])
|
if ([aCoder containsValueForKey: @"NS.string"])
|
||||||
{
|
{
|
||||||
string = (NSString*)[(NSKeyedUnarchiver*)aCoder
|
NSString *string = nil;
|
||||||
_decodePropertyListForKey: @"NS.string"];
|
|
||||||
}
|
string = (NSString*)[(NSKeyedUnarchiver*)aCoder
|
||||||
|
_decodePropertyListForKey: @"NS.string"];
|
||||||
|
self = [self initWithString: string];
|
||||||
|
}
|
||||||
else if ([aCoder containsValueForKey: @"NS.bytes"])
|
else if ([aCoder containsValueForKey: @"NS.bytes"])
|
||||||
{
|
{
|
||||||
string = (NSString*)[(NSKeyedUnarchiver*)aCoder
|
id bytes = [(NSKeyedUnarchiver*)aCoder
|
||||||
decodeObjectForKey: @"NS.bytes"];
|
decodeObjectForKey: @"NS.bytes"];
|
||||||
}
|
|
||||||
|
|
||||||
self = [self initWithString: string];
|
if ([bytes isKindOfClass: NSStringClass])
|
||||||
|
{
|
||||||
|
self = [self initWithString: (NSString*)bytes];
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
self = [self initWithData: (NSData*)bytes
|
||||||
|
encoding: NSUTF8StringEncoding];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// empty string
|
||||||
|
self = [self initWithString: @""];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue