• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
decoding arabic text broken
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Prev by Date: Re: Reading property lists for other applications
  • Next by Date: Re: Cocoa Books?
  • Previous by thread: Re: Reading property lists for other applications
  • Next by thread: Re: decoding arabic text broken
  • Index(es):
    • Date
    • Thread