Re: Converting wchar_t string to NSString
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.