All Projects → gumob → PunycodeSwift

gumob / PunycodeSwift

Licence: MIT license
PunycodeSwift is a pure Swift library to allows you to encode and decode punycoded strings

Programming Languages

swift
15916 projects
ruby
36898 projects - #4 most used programming language
shell
77523 projects
objective c
16641 projects - #2 most used programming language

Projects that are alternatives of or similar to PunycodeSwift

Contentful.swift
A delightful Swift interface to Contentful's content delivery API.
Stars: ✭ 132 (+594.74%)
Mutual labels:  tvos, carthage
Svprogresshud
A clean and lightweight progress HUD for your iOS and tvOS app.
Stars: ✭ 12,339 (+64842.11%)
Mutual labels:  tvos, carthage
Ducttape
📦 KeyPath dynamicMemberLookup based syntax sugar for Swift.
Stars: ✭ 138 (+626.32%)
Mutual labels:  tvos, carthage
TVKit
UI components for tvOS
Stars: ✭ 20 (+5.26%)
Mutual labels:  tvos, carthage
Iso8601
ISO8601 date parser and writer
Stars: ✭ 213 (+1021.05%)
Mutual labels:  tvos, carthage
Fontawesome.swift
Use FontAwesome in your Swift projects
Stars: ✭ 1,513 (+7863.16%)
Mutual labels:  tvos, carthage
Cdmarkdownkit
An extensive Swift framework providing simple and customizable markdown parsing.
Stars: ✭ 158 (+731.58%)
Mutual labels:  tvos, carthage
Mixpanel
Unofficial Swift Mixpanel client
Stars: ✭ 93 (+389.47%)
Mutual labels:  tvos, carthage
Cache
Swift caching library
Stars: ✭ 210 (+1005.26%)
Mutual labels:  tvos, carthage
L10n Swift
Localization of the application with ability to change language "on the fly" and support for plural form in any language.
Stars: ✭ 177 (+831.58%)
Mutual labels:  tvos, carthage
Diff
Simple diff library in pure Swift
Stars: ✭ 110 (+478.95%)
Mutual labels:  tvos, carthage
Dots
Lightweight Concurrent Networking Framework
Stars: ✭ 35 (+84.21%)
Mutual labels:  tvos, carthage
Swifterswift
A handy collection of more than 500 native Swift extensions to boost your productivity.
Stars: ✭ 10,706 (+56247.37%)
Mutual labels:  tvos, carthage
Sqift
Powerful Swift wrapper for SQLite
Stars: ✭ 119 (+526.32%)
Mutual labels:  tvos, carthage
Sdwebimagewebpcoder
A WebP coder plugin for SDWebImage, use libwebp
Stars: ✭ 101 (+431.58%)
Mutual labels:  tvos, carthage
Color
Color utilities for macOS, iOS, tvOS, and watchOS
Stars: ✭ 145 (+663.16%)
Mutual labels:  tvos, carthage
Swiftyattributes
A Swifty API for attributed strings
Stars: ✭ 1,303 (+6757.89%)
Mutual labels:  tvos, carthage
Kvconstraintkit
An Impressive Auto Layout DSL for iOS, tvOS & OSX. & It is written in pure swift.
Stars: ✭ 91 (+378.95%)
Mutual labels:  tvos, carthage
Cocoalumberjack
A fast & simple, yet powerful & flexible logging framework for Mac and iOS
Stars: ✭ 12,584 (+66131.58%)
Mutual labels:  tvos, carthage
Theanimation
Type-safe CAAnimation wrapper. It makes preventing to set wrong type values.
Stars: ✭ 214 (+1026.32%)
Mutual labels:  tvos, carthage

Carthage compatible Version Platform Build Status codecov Language Language Packagist

PunycodeSwift

PunycodeSwift is a pure Swift library to allows you to encode and decode punycoded strings by using String extension.

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 10.2 or later
  • Swift 4.2 or later

Installation

Carthage

Add the following to your Cartfile and follow these instructions.

github "gumob/PunycodeSwift"          # Latest (Swift 5.0)
github "gumob/PunycodeSwift" ~> 2.0   # Swift 5.0
github "gumob/PunycodeSwift" ~> 1.0   # Swift 4.2

CocoaPods

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

platform :ios, '9.3'
use_frameworks!

pod 'Punycode'             # Latest (Swift 5.0)
pod 'Punycode', '~> 2.0'   # Swift 5.0
pod 'Punycode', '~> 1.0'   # Swift 4.2

Usage

Encode and decode IDNA:

import Punycode

var sushi: String = "寿司"

sushi = sushi.idnaEncoded!
print(sushi)  // xn--sprr0q

sushi = sushi.idnaDecoded!
print(sushi)  // "寿司"

Encode and decode Punycode directly:

import Punycode

var sushi: String = "寿司"

sushi = sushi.punycodeEncoded!
print(sushi)  // sprr0q

sushi = sushi.punycodeDecoded!
print(sushi)  // "寿司"

Copyright

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

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].