• 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: utf8 to NSString crasher
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: utf8 to NSString crasher
      • From: Waqar Malik <email@hidden>
References: 
 >utf8 to NSString crasher (From: Waqar Malik <email@hidden>)

  • Prev by Date: Re: nibless applications
  • Next by Date: Re: utf8 to NSString crasher
  • Previous by thread: Re: utf8 to NSString crasher
  • Next by thread: Re: utf8 to NSString crasher
  • Index(es):
    • Date
    • Thread