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 protected])

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to