views:

43

answers:

1

I tried constructing the following NSURL for a custom URL scheme:

NSURL  *url = [NSURL URLWithString:@"tweetie:///post?message=안녕 모두"];
[[UIApplication sharedApplication] openURL:url];

but it doesn't perform correctly. How would you construct such a URL with non-English elements?

+2  A: 

Apparently you may only send US-ASCII characters in URI strings. Try adding percent escapes to your string before sending it:

NSURL* url = [NSURL URLWithString:
   [@"tweetie:///post?message=안녕 모두" 
        stringByAddingPercentEscapesUsingEncoding: NSUTF8StringEncoding]];

See http://stackoverflow.com/questions/3649966/string-conversion-in-objective-c

AdamH
Thanks Adam .It works fine
arunkumar.p