开发者

decoding problem uiwebview

i am using uiwebview in my application. there are some links when user clicks a http search starts. it works fine but i have problems while getting "%58 den ysnky'ye tepki" it is given as "X'den ysnky'ye tepki". it has problems with % char.

identifier:%58'den%20ysnky'ye%20tepki

decoded identif开发者_如何学JAVAier:X'den ysnky'ye tepki

i am using stringByReplacingPercentEscapesUsingEncoding:NSUTF8StringEncoding to decode the string like that;

NSLog(@"identifier:%@", identifier); identifier = [identifier stringByReplacingPercentEscapesUsingEncoding:NSUTF8StringEncoding]; NSLog(@"decoded identifier:%@", identifier);

how can i get the correct string? thanks...


It looks like your string may not be encoded properly in the first place. %58 is the correct encoding for the letter “X” (see this ASCII table). As far as I can tell, therefore, the decode is behaving properly.

What are you expecting?

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜