Re: String Encoding problem with Unicode
Re: String Encoding problem with Unicode
- Subject: Re: String Encoding problem with Unicode
- From: Alastair Houghton <email@hidden>
- Date: Thu, 10 Jul 2008 16:12:15 +0100
AAARGH!
This is a Cocoa question (and I thought I was replying to the Cocoa
list too). Sandeep, please don't BCC mailing lists, and please post
questions in *one* place---even if you're not sure, someone will tell
you where to ask if it isn't right. (And apologies to the ObjC list
for continuing this thread here.)
On 10 Jul 2008, at 16:08, Alastair Houghton wrote:
On 10 Jul 2008, at 15:57, Sandeep Nair wrote:
i want to convert a NSString to CString using Unicode Encoding.
I think you need to be clearer about your requirements than that.
Do you want UTF-32? Or UTF-16? Or UCS-2? Or UTF-8? Or one of the
other less well known UTFs?
And if you want anything other than UTF8, you also need to realise
that you won't be able to use strcpy() because the individual code
units are not 8-bit elements. You certainly can't store UCS4, UTF16
or UCS2 in a C string and expect it to work properly because there
are very likely going to be NUL bytes.
Most likely you want UTF8, in which case what's wrong with
[myString UTF8String]
??
Kind regards,
Alastair.
--
http://alastairs-place.net
--
http://alastairs-place.net
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden