How do I convert NSString to NSData?

First off, you should use dataUsingEncoding: instead of going through UTF8String You only use UTF8String when you need a C string in that encoding Then, for “Unicode” (specifically, UTF-16), just pass NSUnicodeStringEncoding instead of NSUTF8StringEncoding in your dataUsingEncoding: message.

First off, you should use dataUsingEncoding: instead of going through UTF8String. You only use UTF8String when you need a C string in that encoding. Then, for “Unicode�

(specifically, UTF-16), just pass NSUnicodeStringEncoding instead of NSUTF8StringEncoding in your dataUsingEncoding: message.

Thanks! I somehow missed dataUsingEncoding in the docs. – William Denniss Sep 15 '10 at 7:01.

I have UTF-8 encoded nsdata from windows server. I want to convert it to nsstring for iphone. Since data contains characters(like degree symbol) which have different values on both platforms, how do I convert data to string.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions