Reputation: 711
I don't see any direct NSString function converting UTF8 to Unicode string? Do I need to use third party codes to do the conversion?
any ideas?
Upvotes: 0
Views: 651
Reputation: 41662
Its pretty easy. First you get the string' length, [str length], then you get a pointer to the unichar bytes (unichar is UTF-16 more or less):
unichar unibuffer[length];
[str getCharacters:unibuffer range:NSRangeMake(0, length]];
Upvotes: 2