mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-30 08:21:25 +00:00
Various unicode fixes made.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@13371 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
e85bd56efa
commit
b2d44357d6
4 changed files with 102 additions and 58 deletions
|
@ -813,7 +813,7 @@ dataUsingEncoding_c(ivars self, NSStringEncoding encoding, BOOL flag)
|
|||
{
|
||||
return nil;
|
||||
}
|
||||
return [NSDataClass dataWithBytesNoCopy: r length: l];
|
||||
return [NSDataClass dataWithBytesNoCopy: r length: l * sizeof(unichar)];
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -1166,12 +1166,12 @@ handle_printf_atsign (FILE *stream,
|
|||
|
||||
b = (unsigned char*)[data bytes];
|
||||
uptr = (unichar*)b;
|
||||
if (*uptr == 0xFFFE)
|
||||
if (*uptr == byteOrderMark)
|
||||
{
|
||||
b = (unsigned char*)++uptr;
|
||||
len -= sizeof(unichar);
|
||||
}
|
||||
else if (*uptr == 0xFEFF)
|
||||
else if (*uptr == byteOrderMarkSwapped)
|
||||
{
|
||||
b = (unsigned char*)++uptr;
|
||||
len -= sizeof(unichar);
|
||||
|
@ -2376,7 +2376,7 @@ handle_printf_atsign (FILE *stream,
|
|||
|
||||
buff = (unichar*)NSZoneMalloc(NSDefaultMallocZone(),
|
||||
sizeof(unichar)*(len+1));
|
||||
buff[0] = 0xFEFF;
|
||||
buff[0] = byteOrderMark;
|
||||
[self getCharacters: &buff[1]];
|
||||
return [NSDataClass dataWithBytesNoCopy: buff
|
||||
length: sizeof(unichar)*(len+1)];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue