Skip to content

Category to add internationalized domain name support to URL and NSURL

Notifications You must be signed in to change notification settings

minacle/IFUnicodeURL

This branch is 3 commits ahead of, 2 commits behind jbrayton/IFUnicodeURL:master.

Folders and files

NameName
Last commit message
Last commit date

Latest commit

7afcdc8 · Apr 30, 2021

History

46 Commits
Mar 21, 2011
Jan 23, 2013
Apr 30, 2021
Dec 5, 2012
Jan 23, 2013
Mar 21, 2011
Jul 3, 2016
Mar 29, 2021
Mar 21, 2011

Repository files navigation

About

IFUnicodeURL is a category for NSURL which will allow it to support Internationalized domain names in URLs.

Usage

Usage is quite simple. Where you'd have normally used NSURL's URLWithString: (or initWithString:) methods, simply use the unicode versions added by the category. There is also a method to retrieve the URL as a string with the hostname converted back into Unicode:

NSURL *url = [NSURL URLWithUnicodeString:@"http://➡.ws/鞰齒"];
NSLog( @"The URL: %@", [url absoluteString] );
NSLog( @"The Unicode URL: %@", [url unicodeAbsoluteString] );

Notes

This uses code from IDN SDK from Verisign, Inc. The entire IDN SDK source package is included in IDNSDK-1.1.0/. I have pulled out and slightly modified (to avoid compiler and analyzer warnings) the files and headers needed so that building this in Xcode is as easy as adding the IFUnicodeURL folder to your project.

Take note of the IDNSDK license which can be found in IDNSDK-1.1.0/doc. (The license is basically a BSD-like license.) The IFUnicodeURL category is licensed under the Simplified BSD License (see IFUnicodeURL-LICENSE.txt)

Author

Sean Heber (@BigZaphod on Twitter) http://www.iconfactory.com

About

Category to add internationalized domain name support to URL and NSURL

Topics

Resources

Stars

Watchers

Forks

Languages

  • C 79.7%
  • Java 13.8%
  • Makefile 3.6%
  • Objective-C 1.4%
  • C++ 0.7%
  • Batchfile 0.4%
  • Other 0.4%