开发者

url encode non latin characters

开发者 https://www.devze.com 2023-03-21 15:06 出处:网络
I need to URL encode a non-latin string (japanese, chinese, or just non ascii characters in spanish/french/italian etc.). I can\'t find any encoders or snippets that deal with more than just ASCII cha

I need to URL encode a non-latin string (japanese, chinese, or just non ascii characters in spanish/french/italian etc.). I can't find any encoders or snippets that deal with more than just ASCII characters to create a URL encoding. Is there a library or some feature I haven't found in OS that can create a fully compliant URL encoding from any UTF8 con开发者_运维百科tent?


Have you tried using

- (NSString *)stringByAddingPercentEscapesUsingEncoding:(NSStringEncoding)encoding

but specifying the appropriate NSStringEncoding related to the language choice?

You can see all the available string encodings here

0

精彩评论

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