Latest 1.3.1
Homepage https://github.com/Wevah/Punycode-Cocoa
License BSD
Platforms osx , ios , tvos , watchos , requires ARC
Authors

Punycode Cocoa

Build Status

v1.3.1 (2017)
by Nate Weaver (Wevah)
https://derailer.org/
https://github.com/Wevah/Punycode-Cocoa

A simple punycode/IDNA category on NSString, based on code and documentation from RFC 3492 and RFC 3490.

Use this to convert internationalized domain names (IDN) between Unicode and ASCII.

To use in your own projects, all you need is NSStringPunycodeAdditions.h/m. This project includes a sample testing app.

Macros

Define PUNYCODE_COCOA_USE_WEBKIT to have Punycode Cocoa methods call internal WebKit methods instead of the custom implementations. Useful if you’re already linking against WebKit, or want additional homograph attack protection. However, this probably won’t be allowed on the App Store due to its use of private methods.

Methods

NSString

@property (readonly, copy, nullable)    NSString *punycodeEncodedString;
@property (readonly, copy, nullable)    NSString *punycodeDecodedString;

Encodes or decodes a string to its punycode-encoded format, stripping variation selectors (U+FE00U+FE0F).

@property (readonly, copy, nullable) NSString *IDNAEncodedString;

If self contains non-ASCII, calls -punycodeEncodedString and prepends xn--.

@property (readonly, copy, nullable) NSString *IDNADecodedString;

Decodes a string returned by -IDNAEncodedString.

@property (readonly, copy, nullable) NSString *encodedURLString;
@property (readonly, copy, nullable) NSString *decodedURLString;

Performs encode/decode operations on each appropriate part (the domain bits) of an URL string.

NSURL

+ (nullable instancetype)URLWithUnicodeString:(NSString *)URLString;

Convenience method equivalent to [NSURL URLWithString:URLString.encodedURLString].

@property (readonly, copy, nullable) NSString *decodedURLString;

Convenience property equivalent to anURL.absoluteString.decodedURLString.


© 2012–2017 Nate Weaver (Wevah)

Latest podspec

{
    "name": "Punycode-Cocoa",
    "version": "1.3.1",
    "summary": "Punycode/IDNA category on NSString, based on RFC 3492, RFC 3490.",
    "description": "A simple punycode/IDNA category on NSString, based on code and documentation from RFC 3492 and RFC 3490. Use this to convert internationalized domain names (IDN) between Unicode and ASCII.nndu00e9ju00e0.vu.example u2192 xn--dj-kia8a.vu.example",
    "homepage": "https://github.com/Wevah/Punycode-Cocoa",
    "license": "BSD",
    "authors": {
        "Nate Weaver (Wevah)": "wevah [snail] derailer [splot] org"
    },
    "source": {
        "git": "https://github.com/Wevah/Punycode-Cocoa.git",
        "tag": "1.3.1"
    },
    "requires_arc": true,
    "source_files": "Pod/**/*",
    "platforms": {
        "osx": null,
        "ios": null,
        "tvos": null,
        "watchos": null
    }
}

Pin It on Pinterest

Share This