Re: String conversion help.
Re: String conversion help.
- Subject: Re: String conversion help.
- From: John Draper <email@hidden>
- Date: Thu, 23 Jun 2005 13:19:03 -0700
Ali Ozer wrote:
In NSString APIs all references to "characters" is UTF-16, in native
endianness.
Hmmm!! I'm going to have to go back and check on this, but I'm sure I
tried it.
But I'll go back and look anyway.
So initWithCharacters:... and getCharacters: should have worked for
you, at least for big endian data on the PowerPC.
Will try it again - just to be sure, but I'm almost for certain I tried
it last week with this
assumption.
However, if the characters are not native endianness, it's best to
use one of the encoding methods joar points out.
I have utilities to convert back and forth for buffers of 16 bit
(words). But once I get
data into the Mac, it's all treated as Big Endian.
I'm surprised that Apple waited until just now to support this.....
because none of the encodings
Apple supports seems to indicate any 16 bit character encodings, unless
they named it
differently. In the Docs, most indicate 8 or 7 bit characters, but 2
or 3 -
NSUnicodeStringEncoding
NSWindowsCP1250StringEncoding
<and a number of other winBlows encodings>
Don't seem to explicitly say the character sizes are 16 bits.
Knowing nothing about WinBlows, I hardly can be expected to know this.
Can I assume that since they don't explicitly specify the character
sizes of 8 or 7 bits
that they are assumed to be 16 bits?
John
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden