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

python - Scipy curvefit RuntimeError:Optimal parameters not found: Number of calls to function has reached maxfev = 1000 -

c# - How to add a new treeview at the selected node? -

java - netbeans "Please wait - classpath scanning in progress..." -