mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-30 00:11:26 +00:00
Quick unicode fix
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@22328 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
f0940778e9
commit
9276628040
2 changed files with 17 additions and 6 deletions
|
@ -1837,14 +1837,12 @@ GSFromUnicode(unsigned char **dst, unsigned int *size, const unichar *src,
|
|||
sl = 6;
|
||||
}
|
||||
|
||||
/* make sure we have enough space for it */
|
||||
while (dpos + sl >= bsize)
|
||||
{
|
||||
GROW();
|
||||
}
|
||||
|
||||
if (sl == 1)
|
||||
{
|
||||
if (dpos >= bsize)
|
||||
{
|
||||
GROW();
|
||||
}
|
||||
ptr[dpos++] = u & 0x7f;
|
||||
}
|
||||
else
|
||||
|
@ -1859,10 +1857,18 @@ GSFromUnicode(unsigned char **dst, unsigned int *size, const unichar *src,
|
|||
u = u >> 6;
|
||||
}
|
||||
|
||||
if (dpos >= bsize)
|
||||
{
|
||||
GROW();
|
||||
}
|
||||
ptr[dpos++] = reversed[sl-1] | ((0xff << (8-sl)) & 0xff);
|
||||
/* add bytes into the output sequence */
|
||||
for (i = sl - 2; i >= 0; i--)
|
||||
{
|
||||
if (dpos >= bsize)
|
||||
{
|
||||
GROW();
|
||||
}
|
||||
ptr[dpos++] = reversed[i] | 0x80;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue