nsurl - how to convert %20 to space in Iphone SDK -
i working on app, in interacting web-service of time. getting problem when added space on somewhere convert space %20 when converting url request. googled couldn't find healthy solution according requirement because changing when url request. here doing.
url = [url stringbyaddingpercentescapesusingencoding:nsutf8stringencoding]; request = [nsurlrequest requestwithurl:[nsurl urlwithstring:url]]; nslog(@"request : %@", request); [[nsurlconnection alloc] initwithrequest:request delegate:self];
and on nslog
show me %20 ever space given. if know kindly suggest me better way solve issue. great me. in advance.
you converting spaces %20 instruction:
url = [url stringbyaddingpercentescapesusingencoding:nsutf8stringencoding]
but necessary in order correct nsurlrequest
, characters need conversion.
you can reconvert them "normal" characters using other nsstring
method: