If the data is in-process UTF16 (i.e. host-endian UTF-16 without BOM), you
should be using -initWithCharacters:length: instead.
Aki
On 2011/02/13, at 15:50, Kyle Sluder wrote:
> On Sun, Feb 13, 2011 at 3:17 PM, Todd Heberlein
> wrote:
>> [[NSString alloc] initWithBytes:byte_stream length:len
On Sun, Feb 13, 2011 at 3:17 PM, Todd Heberlein wrote:
> [[NSString alloc] initWithBytes:byte_stream length:len
> encoding:NSUTF16LittleEndianStringEncoding]
Just make sure you're guaranteed to get little-endian UTF-16 from your
C++ string. :)
--Kyle Sluder
_
On Feb 11, 2011, at 11:10 AM, Kyle Sluder wrote:
> NSUnicodeStringEncoding is an alias for NSUTF16StringEncoding. You're
> best off getting UTF16 from your C++ string and explicitly using the
> NSUTF16StringEncoding constant when creating your NSString. Since
> UTF16
or w/o BOM)) that I need to
> encode into an NSString. Does the NSUnicodeStringEncoding refer to UTF-8
> encoding?
No. See the NSStringEncoding documentation:
http://developer.apple.com/library/mac/documentation/Cocoa/Reference/Foundation/Classes/NSString_Class/Reference/NSString.html#//ap
NSUnicodeStringEncoding refer to UTF-8
encoding?
Thanks,
Todd
___
Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe