I want to decode an UT8 encoded string.
The input string is "Ã¸Ã¦-test-2.txt"
and after decoding it should become
I found many API to encode the NSString or NSData to UT8 (NSUTF8StringEncoding) but was not able to find the way to decode it.
What I have tried until now:-
NSString *str = [[NSString alloc] initWithUTF8String:[strToDecode cStringUsingEncoding:NSUTF8StringEncoding]];
[NSString stringWithUTF8String:[strToDecode cStringUsingEncoding:[NSString defaultCStringEncoding]]]