mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-22 16:33:29 +00:00
Tidied
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@17447 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
090b0a10f2
commit
ebeac05202
2 changed files with 5 additions and 47 deletions
|
@ -3,6 +3,7 @@
|
|||
* Source/NSString.m: nodeToObject() fix error in handling escape
|
||||
sequences in strings ... only treat a backslash specially when it
|
||||
is immediately followed by 'U' or 'u' and four hexadecimal digits.
|
||||
* Source/GSCompatibility.m: match changes to property list escapes
|
||||
* Tools/plist-0_9.dtd: document unicode escapes.
|
||||
|
||||
2003-08-02 Adam Fedor <fedor@gnu.org>
|
||||
|
|
|
@ -290,27 +290,10 @@ XString(NSString* obj, GSMutableString *output)
|
|||
case '"':
|
||||
len += 6;
|
||||
break;
|
||||
case '\\':
|
||||
len += 1;
|
||||
break;
|
||||
|
||||
default:
|
||||
if (c < 0x20)
|
||||
{
|
||||
if (c == 0x09 || c == 0x0A || c == 0x0D)
|
||||
{
|
||||
len++;
|
||||
}
|
||||
else
|
||||
{
|
||||
len += 4;
|
||||
}
|
||||
}
|
||||
else if (c > 0xD7FF && c < 0xE000)
|
||||
{
|
||||
len += 6;
|
||||
}
|
||||
else if (c > 0xFFFD)
|
||||
if ((c < 0x20 && (c != 0x09 && c != 0x0A && c != 0x0D))
|
||||
|| (c > 0xD7FF && c < 0xE000) || c > 0xFFFD)
|
||||
{
|
||||
len += 6;
|
||||
}
|
||||
|
@ -362,27 +345,10 @@ XString(NSString* obj, GSMutableString *output)
|
|||
map[wpos++] = 't';
|
||||
map[wpos++] = ';';
|
||||
break;
|
||||
case '\\':
|
||||
map[wpos++] = '\\';
|
||||
map[wpos++] = '\\';
|
||||
break;
|
||||
|
||||
default:
|
||||
if (c < 0x20)
|
||||
{
|
||||
if (c == 0x09 || c == 0x0A || c == 0x0D)
|
||||
{
|
||||
map[wpos++] = c;
|
||||
}
|
||||
else
|
||||
{
|
||||
map[wpos++] = '\\';
|
||||
map[wpos++] = '0' + ((c / 64) & 7);
|
||||
map[wpos++] = '0' + ((c / 8) & 7);
|
||||
map[wpos++] = '0' + (c & 7);
|
||||
}
|
||||
}
|
||||
else if (c > 0xD7FF && c < 0xE000)
|
||||
if ((c < 0x20 && (c != 0x09 && c != 0x0A && c != 0x0D))
|
||||
|| (c > 0xD7FF && c < 0xE000) || c > 0xFFFD)
|
||||
{
|
||||
map[wpos++] = '\\';
|
||||
map[wpos++] = 'U';
|
||||
|
@ -391,15 +357,6 @@ XString(NSString* obj, GSMutableString *output)
|
|||
map[wpos++] = hexdigits[(c>>4) & 0xf];
|
||||
map[wpos++] = hexdigits[c & 0xf];
|
||||
}
|
||||
else if (c > 0xFFFD)
|
||||
{
|
||||
map[wpos++] = '\\';
|
||||
map[wpos++] = hexdigits[(c>>12) & 0xf];
|
||||
map[wpos++] = hexdigits[(c>>8) & 0xf];
|
||||
map[wpos++] = hexdigits[(c>>4) & 0xf];
|
||||
map[wpos++] = hexdigits[c & 0xf];
|
||||
map[wpos++] = '\\';
|
||||
}
|
||||
else
|
||||
{
|
||||
map[wpos++] = c;
|
||||
|
|
Loading…
Reference in a new issue