• 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: How to get an NSString from a non-terminated array of unicode chars (length is known)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to get an NSString from a non-terminated array of unicode chars (length is known)


  • Subject: Re: How to get an NSString from a non-terminated array of unicode chars (length is known)
  • From: John Stiles <email@hidden>
  • Date: Tue, 04 Mar 2008 10:40:44 -0800

To be clear, I'm not trying to say that 16-bit wchar_t has no value.

Honestly, I think Apple should have much better support for it. If you're porting an app from Windows, you probably have to deal with WCHARs in some fashion. I'd like to say I have a radar for it but I'm honestly not sure. It's been a few years since the last time I had to deal with 16-bit wchar_ts. At the time I remember needing to borrow large chunks of MSL from CodeWarrior, and getting it to compile on Xcode… bleck.



Brady Duga wrote:

On Mar 4, 2008, at 10:13 AM, John Stiles wrote:

However, don't expect to be able to use any standard library calls in this mode. wcslen, wcscpy, wcscat? Roll your own. swprintf?
Just forget about it.

If you need to.


The limitations here make it difficult to leverage 16-bit wchar_t effectively, IMO.

I use a fairly large library that is integrated with a Cocoa app that uses 16 bit wchar_t. It is an emulation environment, so having 16 bit wchar_t is important for testing purposes. Works fine. Also, any libraries that might be used across platforms needs to be wchar_t size agnostic, though in that case you can probably get away with assuming returned wchar_ts are 32 bit when on the Mac. In any case, it is generally best not to assume you know the size of a wchar_t (and there is rarely a need to assume it).


--Brady
_______________________________________________

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


References: 
 >How to get an NSString from a non-terminated array of unicode chars (length is known) (From: Stuart Malin <email@hidden>)
 >Re: How to get an NSString from a non-terminated array of unicode chars (length is known) (From: Dave Camp <email@hidden>)
 >Re: How to get an NSString from a non-terminated array of unicode chars (length is known) (From: Brady Duga <email@hidden>)
 >Re: How to get an NSString from a non-terminated array of unicode chars (length is known) (From: John Stiles <email@hidden>)
 >Re: How to get an NSString from a non-terminated array of unicode chars (length is known) (From: Brady Duga <email@hidden>)

  • Prev by Date: lock Keyboard for Kisok-Mode
  • Next by Date: Directly using NSString's "hash" (or equivalent) on unichar pointer
  • Previous by thread: Re: How to get an NSString from a non-terminated array of unicode chars (length is known)
  • Next by thread: Re: How to get an NSString from a non-terminated array of unicode chars (length is known)
  • Index(es):
    • Date
    • Thread