4

when I use NSASCIIStringEncoding to encode some Chinese character for a GET request.

NSLog(@"%@",searchText); NSString *stringForSearch = [searchText stringByAddingPercentEscapesUsingEncoding:NSASCIIStringEncoding]; NSLog(@"%@",stringForSearch); 

2012-05-05 23:51:02.669 StarHopeFundingApprovalSystem[756:f803] 中

2012-05-05 23:51:06.305 StarHopeFundingApprovalSystem[756:f803] (null)

And first log is a Chinese character but the second log is always (null), Pls help me with this , thank you in advance.

1 Answer 1

7

Try using NSUTF8StringEncoding insted of NSASCIIStringEncoding.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.