iPhone URL encoding Problem

后端 未结 2 1272
轮回少年
轮回少年 2021-01-06 07:06

Have a slight problem. Trying to post XML to a server. To do this, I have to encode the XML string in URL format.

NSString *encodedString = [NSString strin         


        
2条回答
  •  日久生厌
    2021-01-06 07:57

    You can try this. I found this helpful.

    NSString *sampleUrl = @"http://www.google.com/search.jsp?params=Java Developer";
    NSString* encodedUrl = [sampleUrl stringByAddingPercentEscapesUsingEncoding:
     NSASCIIStringEncoding];
    

提交回复
热议问题