Created
June 12, 2012 20:46
-
-
Save dive/2920023 to your computer and use it in GitHub Desktop.
iOS 5 cyrillic domain byg
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
NSString *string = [NSString stringWithUTF8String: @"http://президент.рф"]; | |
NSURL *url = [NSURL URLWithString:[string stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]]; | |
After this operations I check NSURL with: | |
[[UIApplication sharedApplication] canOpenURL:url] | |
canOpenURL return true. Then I open this NSURL at build-in browser Safari, | |
Safari told me that this page cannot be opened | |
(encoded URL seems like: http://xn--d1abbgf6aiiy.xn--p1ai), | |
after this I just press Refresh at browser without any additional actions | |
and Safari load URL fine, decode http://xn--d1abbgf6aiiy.xn--p1ai to http://президент.рф | |
and show me well-formed link. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi!
Tell me, please, where it is inserted?