Good day!

How to open a site from the application, whose name is in Cyrillic?

NSString *clickedSite = @"http://адрес.рф"; [[UIApplication sharedApplication] openURL:clickedSite]; 

With English domains everything is fine - the browser opens. Or is it only when testing on the emulator and on a real device, everything will work?

    2 answers 2

    You can do without third-party libraries. This code will help you to open a Cyrillic website:

     NSString *clickedSite = @"http://адрес.рф"; NSURL *url = [NSURL URLWithString:[clickedSite stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]]; [[UIApplication sharedApplication] openURL:url]; 

      Found recoder : on github

       stringValue = stringValue.encodedURLString; 

      After which the address opened.

      • one
        Why use something third-party if you can use the standard one? Keep the future: NSString * clickedSite = @ " adress.rf "; NSURL * url = [NSURL URLWithString: [clickedSite stringByAddingPercentEscapesUsingEncoding: NSUTF8StringEncoding]]; [[UIApplication sharedApplication] openURL: url]; - runia
      • Thank! If you add as an answer - be sure to mark as correct. - Chekist