开发者

NSURL encoding using iso-8859-1 instead of UTF8

开发者 https://www.devze.com 2023-01-09 06:34 出处:网络
I need to convert a NSString to a NSURL using the iso-8859-1 instead of UTF8 (like here: Re-encode url from utf-8 encoded to iso-88开发者_StackOverflow社区59-1 encoded) but i don\'t know how to achiev

I need to convert a NSString to a NSURL using the iso-8859-1 instead of UTF8 (like here: Re-encode url from utf-8 encoded to iso-88开发者_StackOverflow社区59-1 encoded) but i don't know how to achieve it.

For example:

http://www.example.com/català 

should be

http://www.example.com/catal%E1

insted of

http://www.example.com/catal%C3%A0

Thanks in advice!


You probably want the NSString method stringByAddingPercentEscapesUsingEncoding:

0

精彩评论

暂无评论...
验证码 换一张
取 消