0

My question comes from here, It works perfectly when I enter an English text, but empty cell appears in Responses when I use other language like Arabic and French.

The problem may be in Xcode, because when I enter arabic text from a site it appears on Responses.

I have tried putting inputString between English letters or symbols, but with no result.

Here's the code:

NSURL *url = [NSURL URLWithString:@"https://docs.google.com/forms/d/1pyKGrF-h9aSC2lrKtuacxMctfVBZv_yNmjoxA4cZIc8/formResponse"];

NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[url standardizedURL]];
[request setHTTPMethod:@"POST"];

//data to send
NSString *postData = @"entry.496878440=";
postData=[postData stringByAppendingString:inputString];

[request setValue:@"application/x-www-form-urlencoded; charset=utf-8" forHTTPHeaderField:@"Content-Type"];

[request setHTTPBody:[postData dataUsingEncoding:NSUTF8StringEncoding]];

NSURLConnection *connection = [[NSURLConnection alloc] initWithRequest:request delegate:self];
[connection start];

EDIT:

It is printed fine on screen using NSLog. Also, when I compare strings using isEqualToString, even using NSUTF8StringEncoding

2
  • Try to log your postData with NSLog after appending the string. What happens? Jun 30, 2015 at 9:45
  • It is OK when I print it using NSLog.
    – Nora
    Jun 30, 2015 at 9:54

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.