mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-30 08:21:25 +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
|
@ -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…
Add table
Add a link
Reference in a new issue