{"id":20016685,"url":"https://github.com/hylo-lang/swift-punycode","last_synced_at":"2026-05-11T08:12:26.452Z","repository":{"id":187561326,"uuid":"664754700","full_name":"hylo-lang/swift-punycode","owner":"hylo-lang","description":"Swift implementation of the Punycode encoding","archived":false,"fork":false,"pushed_at":"2023-07-10T17:15:43.000Z","size":5,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-01-12T15:45:30.941Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hylo-lang.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2023-07-10T17:10:55.000Z","updated_at":"2023-07-30T01:57:45.000Z","dependencies_parsed_at":"2023-08-11T04:36:21.728Z","dependency_job_id":null,"html_url":"https://github.com/hylo-lang/swift-punycode","commit_stats":null,"previous_names":["hylo-lang/swift-punycode"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hylo-lang%2Fswift-punycode","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hylo-lang%2Fswift-punycode/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hylo-lang%2Fswift-punycode/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hylo-lang%2Fswift-punycode/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hylo-lang","download_url":"https://codeload.github.com/hylo-lang/swift-punycode/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241451666,"owners_count":19964901,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-13T08:12:39.523Z","updated_at":"2026-05-11T08:12:21.405Z","avatar_url":"https://github.com/hylo-lang.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Swift Punycode\n\n**Swift Punycode** is a Swift implementation of the Punycode encoding, as described in RFC 3492.\n\n Punycode is a simple and efficient transfer encoding syntax designed to uniquely and reversibly transforms a Unicode string into an ASCII string.\n ASCII characters in the Unicode string are represented literally, and non-ASCII characters are represented by ASCII characters.\n \n## Usage\n\n**Swift Punycode** adds two methods to `Swift.String`.\n\n- `String.punycode(delimiter:encodingDigitWith:)` encodes a string into Punycode.\n- `String.init?(punycode:delimiter:decodingDigitWith:)` decoes a Punycode string.\n\nFor example:\n\n```swift\nimport Punycode\n\nlet greetings = \"みなさん、こんにちは!\"\nlet encoded = greetings.punycode()\nprint(encoded) // Prints \"!-63t0lg6d7bk7a1ksic\"\n\nlet decoded = String(punycode: encoded)!\nprint(decoded) // Prints \"みなさん、こんにちは!\"\n```\n\nBy default, the separator between the literal part and the digits is `\"-\"`, as specified in RFC 3492.\nFurther, digits are encoded as single characters in base 36 (e.g., 5 =\u003e \"5\", 11 =\u003e \"b\").\n\n## Installation\n\nTo use the **Swift Punycode** in a SwiftPM project,  add the following line to the dependencies in your `Package.swift` file:\n\n```swift\n.package(url: \"https://github.com/val-lang/swift-punycode\", from: \"1.0.0\"),\n```\n\nInclude `\"Punycode\"` as a dependency for your executable target:\n\n```swift\n.target(name: \"\u003ctarget\u003e\", dependencies: [\n  .product(name: \"Punycode\", package: \"swift-punycode\"),\n]),\n```\n\nFinally, add `import Punycode` to your source code.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhylo-lang%2Fswift-punycode","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhylo-lang%2Fswift-punycode","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhylo-lang%2Fswift-punycode/lists"}