gumob / BootstringSwift

A pure Swift library to allows you to encode and decode punycoded strings

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Carthage compatible Version Platform Build Status codecov Language Packagist

⚠️ This repository is no longer maintained. Please use PunycodeSwift instead.

BootstringSwift

BootstringSwift is a pure Swift library to allows you to encode and decode punycoded strings using Bootstring algorithm. Most of all source codes are ported from SwiftBootstring. The version on this repository is added multiple platform support, support for Carthage and Cocoapods.

What is Punycode?

Punycode is a representation of Unicode with the limited ASCII character subset used for Internet host names. Using Punycode, host names containing Unicode characters are transcoded to a subset of ASCII consisting of letters, digits, and hyphen, which is called the Letter-Digit-Hyphen (LDH) subset. For example, München (German name for Munich) is encoded as Mnchen-3ya. (Wikipedia)

Requirements

  • iOS 9.3 or later
  • macOS 10.12 or later
  • tvOS 12.0 or later
  • Swift 4.2

* No plans to support tvOS 11 or earlier for now

Installation

Carthage

Add the following to your Cartfile and follow these instructions.

github "gumob/BootstringSwift"

CocoaPods

To integrate Bootstring into your project, add the following to your Podfile.

platform :ios, '9.3'
use_frameworks!

pod 'Bootstring'

Usage

import Bootstring

"寿司".addingPunycodeEncoding          // Optional("xn--sprr0q")
"xn--sprr0q".removingPunycodeEncoding // Optional("寿司")

Copyright

Bootstring is released under MIT license, which means you can modify it, redistribute it or use it however you like.

About

A pure Swift library to allows you to encode and decode punycoded strings

License:MIT License


Languages

Language:Swift 63.2%Language:Ruby 25.5%Language:Shell 9.6%Language:Objective-C 1.7%