decoding arabic text broken
decoding arabic text broken
- Subject: decoding arabic text broken
- From: Seth Delackner <email@hidden>
- Date: Thu, 4 Aug 2005 03:51:36 +0000
- Mail-followup-to: email@hidden
Given arabic data in windows codepage 1256 format:
0xcd 0xdd 0xc9
this should be three arabic characters, the middle being "ف". So we have:
unsigned v = CFStringConvertWindowsCodepageToEncoding(1256) ;
v = CFStringConvertEncodingToNSStringEncoding(v) ;
which results in the value 0x80000506 (which is 2147484934).
Creating an NSString:
(gdb) po rawText
<cdddc9>
(gdb) call (void)NSLog(@"foo: %@", (id)[[NSString alloc] initWithData: rawText encoding: v])
foo: ﺣ÷ﺓ
For those in non-unicode mail readers, that is "an arabic character, a division symbol, and an arabic character".
Wha?
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden