iOS 关于URL 有中文 转码问题

2017-09-12  本文已影响0人  Zakerberg

[ [ NSString stringWithFormat:@"https://itunes.apple.com/cn/app/实习网/id%@?mt=8",YourAppID] stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLQueryAllowedCharacterSet ] ];

还有一些有用的字符集

URLFragmentAllowedCharacterSet  "#%<>[\]^`{|}

URLHostAllowedCharacterSet      "#%/<>?@\^`{|}

URLPasswordAllowedCharacterSet  "#%/:<>?@[\]^`{|}

URLPathAllowedCharacterSet      "#%;<>?[\]^`{|}

URLQueryAllowedCharacterSet     "#%<>[\]^`{|}

URLUserAllowedCharacterSet      "#%/:<>?@[\]^`

上一篇下一篇

猜你喜欢

热点阅读