• 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
Re: Displaying Unicode
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Displaying Unicode


  • Subject: Re: Displaying Unicode
  • From: Ali Ozer <email@hidden>
  • Date: Thu, 29 Nov 2001 00:54:40 -0800

> returnString = [NSString stringWithString: (NSString *)
> uniString]; // works-- but not without the cast... why?

You don't need this step, as CFStrings and NSStrings are toll-free
bridged, meaning they are equivalent. (A cast is all you need.)

> CFDataRef stringData = CFDataCreateWithBytesNoCopy(NULL, (const
> UInt8 *) parsePtr, stringLength, kCFAllocatorNull);
> uniString = CFStringCreateFromExternalRepresentation(NULL,
> stringData, kCFStringEncodingUnicode);
> CFRelease(stringData);

These other steps look fine, and assuming the original data was in UCS-2
format, should work. You should open the original data in TextEdit (or
copy/paste) and see how it shows up...

Ali


  • Follow-Ups:
    • Re: Displaying Unicode
      • From: Bill Bumgarner <email@hidden>
References: 
 >Displaying Unicode (From: Bill Bumgarner <email@hidden>)

  • Prev by Date: Displaying Unicode
  • Next by Date: Re: Programatically changing the spelling language
  • Previous by thread: Displaying Unicode
  • Next by thread: Re: Displaying Unicode
  • Index(es):
    • Date
    • Thread