unicode - iPhone - Convert NSString encoding from WindowsCP1251 to UTF8 -


how can have conversion nswindowscp1251stringencoding utf-8? had several attempts no 1 worked should. last try was:

nsdata *dt = [mystr datausingencoding:nsutf8stringencoding]; nsstring *str = [nsstring alloc] initwithdata:dt encoding:nswindowscp1251stringencoding]; 

the result of str unreadable. did encounter similar?

i think close:

// convert cp1251 nsdata *dt = [mystr datausingencoding:nswindowscp1251stringencoding];  // load utf8 nsstring *str = [nsstring alloc] initwithdata:dt encoding:nsutf8stringencoding]; 

Comments

Popular posts from this blog

delphi - TJvHidDeviceController "DevicePath" always showing "\" -

Disabling Android home button for industry application -

asp.net mvc 3 - Unexpected "foreach" keyword after "@" character -