Small tweak

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@17653 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Richard Frith-Macdonald 2003-09-11 05:02:26 +00:00
parent 4c190e487d
commit 77ee3e21e5
2 changed files with 8 additions and 3 deletions

View file

@ -1,3 +1,7 @@
2003-09-11 Richard Frith-Macdonald <rfm@gnu.org>
* Source/Unicode.m: Fix minor errors in utf8 handling.
2003-09-10 David Ayers <d.ayers@inode.at>
* Headers/Additions/GNUstepBase/GSObjCRuntime.h (GSObjCSuper):

View file

@ -1640,7 +1640,7 @@ GSFromUnicode(unsigned char **dst, unsigned int *size, const unichar *src,
u1 = ((u1 & 0xff00 >> 8) + ((u1 & 0x00ff) << 8));
}
/* possibly get second character and caculate 'u' */
/* possibly get second character and calculate 'u' */
if ((u1 >= 0xd800) && (u1 < 0xdc00))
{
if (spos >= slen)
@ -1653,11 +1653,12 @@ GSFromUnicode(unsigned char **dst, unsigned int *size, const unichar *src,
u2 = src[spos++];
if (swapped == YES)
{
u2 = ((u1 & 0xff00 >> 8) + ((u1 & 0x00ff) << 8));
u2 = ((u2 & 0xff00 >> 8) + ((u2 & 0x00ff) << 8));
}
if ((u2 < 0xdc00) && (u2 > 0xdfff))
{
spos--;
result = NO;
break;
}
@ -1709,7 +1710,7 @@ GSFromUnicode(unsigned char **dst, unsigned int *size, const unichar *src,
}
else
{
unsigned i;
int i;
unsigned char reversed[8];
/* split value into reversed array */