objective c - NSMutableDictionary with accent -


i working nsmutabledictionary , in array using words accent , add work, fine. problem retrieve , work with.

to add: [dicpt_sp setobject:@"são paulo" forkey:@"são paulo"];

when retrieving, getting: "s\u00e3o paulo"

how can solve issue? think simple, cant find solution googling. idea welcome.

i think need encode string first...this unicode string getting. need encode utf8 string this.

char cstring[] = "this isn\u2019t bike";     nsdata *data = [nsdata datawithbytes:cstring length:strlen(cstring)];     nsstring *string = [[nsstring alloc] initwithdata:data encoding:nsutf8stringencoding];     nslog(@"result string: %@", string); 

or

nsstring *input = @"\\u5404\\u500b\\u90fd";     nsstring *convertedstring = [input mutablecopy];     cfstringref transform = cfstr("any-hex/java");     cfstringtransform((__bridge cfmutablestringref)convertedstring, null, transform, yes);     nslog(@"convertedstring: %@", convertedstring); 

Comments

Popular posts from this blog

javascript - DIV "hiding" when changing dropdown value -

Does Firefox offer AppleScript support to get URL of windows? -

android - How to install packaged app on Firefox for mobile? -