Re: NSString and wchar_t
Re: NSString and wchar_t
- Subject: Re: NSString and wchar_t
- From: James Gregurich <email@hidden>
- Date: Tue, 18 Dec 2001 18:54:46 -0600
On Tuesday, December 18, 2001, at 10:12 AM, Sandy Martel wrote:
On Tuesday, December 18, 2001, at 10:08 AM, James Gregurich wrote:
What is the proper way to convert between wchar_t* and
NSString/NSMutableString in Objective C++?
wchar_t is a unicode (double byte) character
no, wchar_t is four bytes with gcc...
you know. I thought that was the case based on what I saw in the
debugger. I thought gdb was playing tricks on me. I'll be glad when
Apple gets the debugger up to par. I supposed I should have tried
sizeof(). On Windows, wchar_t is 2 byte.
What should I use to get a unicode string (2 bytes)? Guess I could do a
typedef and make a two byte data structure to be a unicode character.
convert it to an NSData and pass that to the NSString.
I know my strings will always be two byte
thanks,
James Gregurich