Re: utf8 to NSString crasher
Re: utf8 to NSString crasher
- Subject: Re: utf8 to NSString crasher
- From: "Michael Ash" <email@hidden>
- Date: Wed, 3 Sep 2008 12:47:50 -0400
On Tue, Sep 2, 2008 at 10:29 PM, Waqar Malik <email@hidden> wrote:
> Is there a canonical way to convert wchat_t to NSString?
There isn't, because there is essentially no canonical wchar_t.
The only requirements for wchar_t is that it be at least 8 bits wide
and that it be compatible with the regular "char" character set, which
is to say ASCII-compatible when we're talking about any reasonable
modern system.
Beyond that, the size and encoding of wchar_t is left entirely up to
the compiler.
Now, on Mac OS X it's *usually* 32 bits and contains UTF-32, so you
can use that information to easily create an NSString from a wchar_t
array. But both the encoding and the size could be different depending
on a number of factors.
Mike
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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/Update your Subscription:
This email sent to email@hidden