String Encoding problem with Unicode
String Encoding problem with Unicode
- Subject: String Encoding problem with Unicode
- From: "Sandeep Nair" <email@hidden>
- Date: Thu, 10 Jul 2008 20:27:14 +0530
Sir,
i want to convert a NSString to CString using Unicode Encoding.
strcpy(cString, [nsString cStringUsingEncoding:NSUnicodeStringEncoding ]);
(or)
CFStringGetCString((CFStringRef)nsString],
cString,1024,
CFStringConvertNSStringEncodingToEncoding(NSUnicodeStringEncoding));
Here i am converting the String back
CFStringRef str1 = CFStringCreateWithCString(NULL, cString,
CFStringConvertNSStringEncodingToEncoding(NSUnicodeStringEncoding));
//kCFStringEncodingUnicode
NSLog((NSString*)str1); //Testing
for example if the nsString value is * **ामन** **मन** **खद then i am
getting only ामन as output.*
the normal conversion to NSString like
[NSString stringWithCString: cString encoding: NSUnicodeStringEncoding];
also returns some crazy results.
Can any one help me to solve this problem????
Thanking you
Regards
Sandeep A.C
_______________________________________________
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