mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-25 09:41:15 +00:00
(serializeToInfo): Only save a string as a cstring if it only contains ASCII characters.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@18052 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
f97029e9b2
commit
ccf66c5058
2 changed files with 14 additions and 2 deletions
|
@ -1,3 +1,8 @@
|
||||||
|
2003-11-05 14:49 Alexander Malmberg <alexander@malmberg.org>
|
||||||
|
|
||||||
|
* Source/NSSerializer.m (serializeToInfo): Only save a string as
|
||||||
|
a cstring if it only contains ASCII characters.
|
||||||
|
|
||||||
2003-11-05 03:10 Alexander Malmberg <alexander@malmberg.org>
|
2003-11-05 03:10 Alexander Malmberg <alexander@malmberg.org>
|
||||||
|
|
||||||
* Source/GSString.m: Reorganize class heirarchy. Remove unused
|
* Source/GSString.m: Reorganize class heirarchy. Remove unused
|
||||||
|
|
|
@ -182,8 +182,15 @@ serializeToInfo(id object, _NSSerializerInfo* info)
|
||||||
[object description]];
|
[object description]];
|
||||||
}
|
}
|
||||||
c = GSObjCClass(object);
|
c = GSObjCClass(object);
|
||||||
if (GSObjCIsKindOf(c, CStringClass)
|
|
||||||
|| (c == MStringClass && ((ivars)object)->_flags.wide == 0))
|
if ((GSObjCIsKindOf(c, CStringClass)
|
||||||
|
|| (c == MStringClass && ((ivars)object)->_flags.wide == 0))
|
||||||
|
/*
|
||||||
|
We can only save it as a c-string if it only contains ASCII characters.
|
||||||
|
Other characters might be decoded incorrectly when deserialized since
|
||||||
|
the c-string encoding might be different then.
|
||||||
|
*/
|
||||||
|
&& [object canBeConvertedToEncoding: NSASCIIStringEncoding])
|
||||||
{
|
{
|
||||||
GSIMapNode node;
|
GSIMapNode node;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue