mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-31 16:50:58 +00:00
Fix output of property lists in incorrect encoding.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@15144 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
f52211e8b0
commit
71620a595c
3 changed files with 18 additions and 9 deletions
|
@ -10,6 +10,8 @@
|
||||||
style property-lists rather than new style or xml style.
|
style property-lists rather than new style or xml style.
|
||||||
* Source/NSUser.m: Use USERPROFILE for default home directory on
|
* Source/NSUser.m: Use USERPROFILE for default home directory on
|
||||||
windoze.
|
windoze.
|
||||||
|
* Source/NSArray.m: Write non-xml property lists as ascii.
|
||||||
|
* Source/NSDictionary.m: Write non-xml property lists as ascii.
|
||||||
|
|
||||||
2002-11-26 Richard Frith-Macdonald <rfm@gnu.org>
|
2002-11-26 Richard Frith-Macdonald <rfm@gnu.org>
|
||||||
|
|
||||||
|
|
|
@ -1029,18 +1029,20 @@ static int compare(id elem1, id elem2, void* context)
|
||||||
{
|
{
|
||||||
NSDictionary *loc = GSUserDefaultsDictionaryRepresentation();
|
NSDictionary *loc = GSUserDefaultsDictionaryRepresentation();
|
||||||
NSString *desc = nil;
|
NSString *desc = nil;
|
||||||
|
NSData *data;
|
||||||
|
|
||||||
if (GSMacOSXCompatiblePropertyLists() == YES)
|
if (GSMacOSXCompatiblePropertyLists() == YES)
|
||||||
{
|
{
|
||||||
GSPropertyListMake(self, loc, YES, NO, 2, &desc);
|
GSPropertyListMake(self, loc, YES, NO, 2, &desc);
|
||||||
|
data = [desc dataUsingEncoding: NSUTF8StringEncoding];
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
GSPropertyListMake(self, loc, NO, NO, 2, &desc);
|
GSPropertyListMake(self, loc, NO, NO, 2, &desc);
|
||||||
|
data = [desc dataUsingEncoding: NSASCIIStringEncoding];
|
||||||
}
|
}
|
||||||
|
|
||||||
return [[desc dataUsingEncoding: NSUTF8StringEncoding]
|
return [data writeToFile: path atomically: useAuxiliaryFile];
|
||||||
writeToFile: path atomically: useAuxiliaryFile];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1053,18 +1055,20 @@ static int compare(id elem1, id elem2, void* context)
|
||||||
{
|
{
|
||||||
NSDictionary *loc = GSUserDefaultsDictionaryRepresentation();
|
NSDictionary *loc = GSUserDefaultsDictionaryRepresentation();
|
||||||
NSString *desc = nil;
|
NSString *desc = nil;
|
||||||
|
NSData *data;
|
||||||
|
|
||||||
if (GSMacOSXCompatiblePropertyLists() == YES)
|
if (GSMacOSXCompatiblePropertyLists() == YES)
|
||||||
{
|
{
|
||||||
GSPropertyListMake(self, loc, YES, NO, 2, &desc);
|
GSPropertyListMake(self, loc, YES, NO, 2, &desc);
|
||||||
|
data = [desc dataUsingEncoding: NSUTF8StringEncoding];
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
GSPropertyListMake(self, loc, NO, NO, 2, &desc);
|
GSPropertyListMake(self, loc, NO, NO, 2, &desc);
|
||||||
|
data = [desc dataUsingEncoding: NSASCIIStringEncoding];
|
||||||
}
|
}
|
||||||
|
|
||||||
return [[desc dataUsingEncoding: NSUTF8StringEncoding]
|
return [data writeToURL: url atomically: useAuxiliaryFile];
|
||||||
writeToURL: url atomically: useAuxiliaryFile];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
|
@ -743,18 +743,19 @@ compareIt(id o1, id o2, void* context)
|
||||||
{
|
{
|
||||||
NSDictionary *loc = GSUserDefaultsDictionaryRepresentation();
|
NSDictionary *loc = GSUserDefaultsDictionaryRepresentation();
|
||||||
NSString *desc = nil;
|
NSString *desc = nil;
|
||||||
|
NSData *data;
|
||||||
|
|
||||||
if (GSMacOSXCompatiblePropertyLists() == YES)
|
if (GSMacOSXCompatiblePropertyLists() == YES)
|
||||||
{
|
{
|
||||||
GSPropertyListMake(self, loc, YES, NO, 2, &desc);
|
GSPropertyListMake(self, loc, YES, NO, 2, &desc);
|
||||||
|
data = [desc dataUsingEncoding: NSUTF8StringEncoding];
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
GSPropertyListMake(self, loc, NO, NO, 2, &desc);
|
GSPropertyListMake(self, loc, NO, NO, 2, &desc);
|
||||||
|
data = [desc dataUsingEncoding: NSASCIIStringEncoding];
|
||||||
}
|
}
|
||||||
|
return [data writeToFile: path atomically: useAuxiliaryFile];
|
||||||
return [[desc dataUsingEncoding: NSUTF8StringEncoding]
|
|
||||||
writeToFile: path atomically: useAuxiliaryFile];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -767,18 +768,20 @@ compareIt(id o1, id o2, void* context)
|
||||||
{
|
{
|
||||||
NSDictionary *loc = GSUserDefaultsDictionaryRepresentation();
|
NSDictionary *loc = GSUserDefaultsDictionaryRepresentation();
|
||||||
NSString *desc = nil;
|
NSString *desc = nil;
|
||||||
|
NSData *data;
|
||||||
|
|
||||||
if (GSMacOSXCompatiblePropertyLists() == YES)
|
if (GSMacOSXCompatiblePropertyLists() == YES)
|
||||||
{
|
{
|
||||||
GSPropertyListMake(self, loc, YES, NO, 2, &desc);
|
GSPropertyListMake(self, loc, YES, NO, 2, &desc);
|
||||||
|
data = [desc dataUsingEncoding: NSUTF8StringEncoding];
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
GSPropertyListMake(self, loc, NO, NO, 2, &desc);
|
GSPropertyListMake(self, loc, NO, NO, 2, &desc);
|
||||||
|
data = [desc dataUsingEncoding: NSASCIIStringEncoding];
|
||||||
}
|
}
|
||||||
|
|
||||||
return [[desc dataUsingEncoding: NSUTF8StringEncoding]
|
return [data writeToURL: url atomically: useAuxiliaryFile];
|
||||||
writeToURL: url atomically: useAuxiliaryFile];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue