Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Displaying Unicode



> 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


References: 
 >Displaying Unicode (From: Bill Bumgarner <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.