wchar_t versus unichar
wchar_t versus unichar
- Subject: wchar_t versus unichar
- From: John Stiles <email@hidden>
- Date: Fri, 9 Jul 2004 16:46:55 -0700
It looks like Cocoa's "unichar" type is two bytes, and wchar_t is four
bytes.
This is causing me grief in weird ways--for example, swprintf(buffer,
L"%S", myString) needs myString to be an array of four-byte wchar_t's.
But [NSString stringWithFormat:@"%S", myString] needs myString to be an
array of two-byte unichars.
Is this correct? Or am I losing my marbles? This paints a weird picture
for wide-character compatibility; I always assumed stringWithFormat
wrapped swprintf at some level.
I know Mac OS X is happier with NS/CFStrings or UTF8, but I am dealing
with a large volume of existing code that uses two-byte Unicode
character arrays (dang Windows) and I don't think they'd be too
thrilled if I rewrote it all.
_______________________________________________
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.