I am receiving a nsstring that is not properly encoded like "mystring%201, where must be "mystring 1". How could I replace all characters that could be interpreted as UTF8? I read a lot of posts but not a full solution. Please note that nsstring is already encoded wrong and I am not asking about how to encode char sequence. Thank you.
- (NSString *)stringByReplacingPercentEscapesUsingEncoding:(NSStringEncoding)encoding
is what you want. basically use it like so:
newString = [myString stringByReplacingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
[urlString stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With