开发者

decode uiwebview string

开发者 https://www.devze.com 2023-01-26 06:29 出处:网络
i have a uiwebview. when i read string (from ) from this uiwebview i encodes come charac开发者_如何学运维ters like #. how can i decode?

i have a uiwebview. when i read string (from ) from this uiwebview i encodes come charac开发者_如何学运维ters like #. how can i decode?

for example it gives %23test instead of #test. i need #test

thanks.


You can use the stringByReplacingPercentEscapesUsingEncoding: method of NSString:

NSString *encoded = @"%23test";
NSString *decoded = [encoded stringByReplacingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
0

精彩评论

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

关注公众号