• 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: Converting wchar_t string to NSString
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Converting wchar_t string to NSString


  • Subject: Re: Converting wchar_t string to NSString
  • From: Andrew Thompson <email@hidden>
  • Date: Sun, 8 Feb 2004 14:19:31 -0500

On Feb 8, 2004, at 12:06 PM, David Elliott wrote:

No, I do know the difference between encoding and character set. I thought it was clear from my message that I was using the wchar_t type (from Panther and Jaguar) and wcs* functions from Panther using a 4-byte (that is what wchar_t is on OS X after all) Unicode character set.

That's the point I was trying to make :) There's no such thing as a "4-byte Unicode character set". Character sets exist independent of any particular representation on any architecture. Change the last part of your sentence to " 4-byte Unicode character encoding" and we're there. Sorry to be pedantic.

Alternatively, I recently found out wxWindows has functions for converting to/from UTF-16 so if NSString can efficiently take that (i.e. without doing another conversion itself) then that would be an option. Right now I'm doing a conversion from wxString (which is using 4-byte wchar_t based strings) to UTF-8 and then to NSString. That involves two conversions when one would be better.

NSString is UTF16 internally, so that should cut your conversions to 1.

AndyT (lordpixel - the cat who walks through walls)
A little bigger on the inside

(see you later space cowboy ...)
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: [SOLVED] Converting wchar_t string to NSString
      • From: David Elliott <email@hidden>
References: 
 >Re: Converting Japanese C- string to NSString (From: Darrin Cardani <email@hidden>)
 >Re: Converting Japanese C- string to NSString (From: John Stiles <email@hidden>)
 >Converting wchar_t string to NSString (From: David Elliott <email@hidden>)
 >Re: Converting wchar_t string to NSString (From: Glen Low <email@hidden>)
 >Re: Converting wchar_t string to NSString (From: Andrew Thompson <email@hidden>)
 >Re: Converting wchar_t string to NSString (From: David Elliott <email@hidden>)

  • Prev by Date: Re: Drawing onto NSImageView subclass (Newbie)
  • Next by Date: Re: Objective-C & Private functions
  • Previous by thread: Re: Converting wchar_t string to NSString
  • Next by thread: Re: [SOLVED] Converting wchar_t string to NSString
  • Index(es):
    • Date
    • Thread