mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-31 08:41:03 +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
12340d7524
commit
5283c204a9
2 changed files with 5 additions and 47 deletions
|
@ -3,6 +3,7 @@
|
||||||
* Source/NSString.m: nodeToObject() fix error in handling escape
|
* Source/NSString.m: nodeToObject() fix error in handling escape
|
||||||
sequences in strings ... only treat a backslash specially when it
|
sequences in strings ... only treat a backslash specially when it
|
||||||
is immediately followed by 'U' or 'u' and four hexadecimal digits.
|
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.
|
* Tools/plist-0_9.dtd: document unicode escapes.
|
||||||
|
|
||||||
2003-08-02 Adam Fedor <fedor@gnu.org>
|
2003-08-02 Adam Fedor <fedor@gnu.org>
|
||||||
|
|
|
@ -290,27 +290,10 @@ XString(NSString* obj, GSMutableString *output)
|
||||||
case '"':
|
case '"':
|
||||||
len += 6;
|
len += 6;
|
||||||
break;
|
break;
|
||||||
case '\\':
|
|
||||||
len += 1;
|
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
default:
|
||||||
if (c < 0x20)
|
if ((c < 0x20 && (c != 0x09 && c != 0x0A && c != 0x0D))
|
||||||
{
|
|| (c > 0xD7FF && c < 0xE000) || c > 0xFFFD)
|
||||||
if (c == 0x09 || c == 0x0A || c == 0x0D)
|
|
||||||
{
|
|
||||||
len++;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
len += 4;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if (c > 0xD7FF && c < 0xE000)
|
|
||||||
{
|
|
||||||
len += 6;
|
|
||||||
}
|
|
||||||
else if (c > 0xFFFD)
|
|
||||||
{
|
{
|
||||||
len += 6;
|
len += 6;
|
||||||
}
|
}
|
||||||
|
@ -362,27 +345,10 @@ XString(NSString* obj, GSMutableString *output)
|
||||||
map[wpos++] = 't';
|
map[wpos++] = 't';
|
||||||
map[wpos++] = ';';
|
map[wpos++] = ';';
|
||||||
break;
|
break;
|
||||||
case '\\':
|
|
||||||
map[wpos++] = '\\';
|
|
||||||
map[wpos++] = '\\';
|
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
default:
|
||||||
if (c < 0x20)
|
if ((c < 0x20 && (c != 0x09 && c != 0x0A && c != 0x0D))
|
||||||
{
|
|| (c > 0xD7FF && c < 0xE000) || c > 0xFFFD)
|
||||||
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)
|
|
||||||
{
|
{
|
||||||
map[wpos++] = '\\';
|
map[wpos++] = '\\';
|
||||||
map[wpos++] = 'U';
|
map[wpos++] = 'U';
|
||||||
|
@ -391,15 +357,6 @@ XString(NSString* obj, GSMutableString *output)
|
||||||
map[wpos++] = hexdigits[(c>>4) & 0xf];
|
map[wpos++] = hexdigits[(c>>4) & 0xf];
|
||||||
map[wpos++] = hexdigits[c & 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
|
else
|
||||||
{
|
{
|
||||||
map[wpos++] = c;
|
map[wpos++] = c;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue