0

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 identifier: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...

4

1 回答 1

1

看起来您的字符串可能一开始就没有正确编码。%58 是字母“X”的正确编码(请参阅此ASCII 表)。因此,据我所知,解码运行正常。

你在期待什么?

于 2010-12-02T18:32:54.687 回答