{"id":28281139,"url":"https://github.com/wevah/idna-cocoa","last_synced_at":"2025-09-09T05:39:09.937Z","repository":{"id":2576904,"uuid":"3557484","full_name":"Wevah/IDNA-Cocoa","owner":"Wevah","description":"Simple interface for IDNA on String and NSString","archived":false,"fork":false,"pushed_at":"2025-07-09T03:14:49.000Z","size":6171,"stargazers_count":60,"open_issues_count":6,"forks_count":14,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-08-18T01:35:00.204Z","etag":null,"topics":["idna","ios","macos","punycode","url"],"latest_commit_sha":null,"homepage":"","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Wevah.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null},"funding":{"github":["Wevah"],"patreon":"Wevah","open_collective":null,"ko_fi":"mrwevah","tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":["https://paypal.me/wevah"]}},"created_at":"2012-02-27T04:58:19.000Z","updated_at":"2025-07-09T03:14:53.000Z","dependencies_parsed_at":"2023-07-07T06:32:23.128Z","dependency_job_id":null,"html_url":"https://github.com/Wevah/IDNA-Cocoa","commit_stats":null,"previous_names":["wevah/punycode-cocoa"],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/Wevah/IDNA-Cocoa","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Wevah%2FIDNA-Cocoa","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Wevah%2FIDNA-Cocoa/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Wevah%2FIDNA-Cocoa/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Wevah%2FIDNA-Cocoa/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Wevah","download_url":"https://codeload.github.com/Wevah/IDNA-Cocoa/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Wevah%2FIDNA-Cocoa/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274249974,"owners_count":25249391,"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","status":"online","status_checked_at":"2025-09-09T02:00:10.223Z","response_time":80,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["idna","ios","macos","punycode","url"],"created_at":"2025-05-21T11:15:40.489Z","updated_at":"2025-09-09T05:39:09.928Z","avatar_url":"https://github.com/Wevah.png","language":"Swift","funding_links":["https://github.com/sponsors/Wevah","https://patreon.com/Wevah","https://ko-fi.com/mrwevah","https://paypal.me/wevah"],"categories":[],"sub_categories":[],"readme":"# IDNA Cocoa\n\nv2.0b4 (2021)\nby Nate Weaver (Wevah)  \nhttps://derailer.org/  \nhttps://github.com/Wevah/Punycode-Cocoa\n\n![Swift](https://github.com/Wevah/IDNA-Cocoa/workflows/Swift/badge.svg)\n\n**Note: This package (or similar packages) is no longer necessary when targeting macOS 14+/iOS 17+/etc., as `(NS)URL` has been updated to do IDNA encoding. It's also possible to use `(NS)URLComponents` on macOS 13+/iOS 16+/etc., as it does IDNA encoding on those OS versions.**\n\nAn IDNA String extension and NSString overlay, based on [UTS #46](https://unicode.org/reports/tr46/). Currently implents the full conversion table and joiner validation.\n\nUse this to convert internationalized domain names (IDN) between Unicode and ASCII.\n\nTo use in your own projects, this repository can be imported as a Swift package.\n\nAlternatively, the files can be manually included: Everything in `Sources/IDNA`:\n\n- UTS46.swift\n- UTS46+Loading.swift\n- Data+Extensions.swift\n- Scanner+Extensions.swift\n- String+Punycode.swift\n\nIf your project needs to call from Objective-C make sure to include `NSString+IDNA.swift` for the `NSString` overlays.\n\n(`UTS46+Conversion.swift` is for importing text files containing UTS #46 mappings and exporting to the binary format used by `UTS46+Loading.swift`, and isn't necessary if you just want to use the encoding/decoding routines.)\n\nNote that these API currently don't do homograph detection.\n\n## Interface\n\n### String/NSString\n\n###### Swift:\n```swift\nvar idnaEncoded: String? { get }\n```\n\n###### Objective-C:\n```objc\n@property (readonly, copy, nullable) NSString *IDNAEncodedString;\n```\n\nIf `self` contains non-ASCII, encodes the string's domain components as Punycode and prepends `xn--` to the transformed components.\n\n-----\n\n###### Swift:\n```swift\nvar idnaDecoded: String? { get }\n```\n\n###### Objective-C:\n```objc\n@property (readonly, copy, nullable) NSString *IDNADecodedString;\n```\n\nDecodes a string returned by `idnaEncoded`/`-IDNAEncodedString`.\n\n-----\n\n###### Swift:\n```swift\nvar encodedURLString: String? { get }\nvar decodedURLString: String? { get }\n```\n\n###### Objective-C:\n```objc\n@property (readonly, copy, nullable) NSString *encodedURLString;\n@property (readonly, copy, nullable) NSString *decodedURLString;\n```\n\nPerforms Punycode encode/decode operations on each appropriate part (the domain bits) of an URL string, and URL encodes/decodes the path/query/fragment.\n\n-----\n\n### URL/NSURL\n\n###### Swift:\n```swift\ninit?(unicodeString: String)\n```\n\n###### Objective-C:\n```objc\n+ (nullable instancetype)URLWithUnicodeString:(NSString *)URLString;\n```\n\nConvenience initializer equivalent to `URL(string: unicodeString.encodedURLString)`/ `[NSURL URLWithString:URLString.encodedURLString]`.\n\n-----\n\n###### Swift:\n```swift\nvar decodedURLString: String? { get }\n```\n\n###### Objective-C:\n```objc\n@property (readonly, copy, nullable) NSString *decodedURLString;\n```\n\nConvenience property equivalent to `someURL.absoluteString.decodedURLString`.\n\n-----\n\n##### Swift:\n```swift\ninit?(unicodeString: String, relativeTo url: URL?) {\n```\n\n##### Objective-C:\n```objc\n+ (nullable instancetype)URLWithUnicodeString:(NSString *)URLString relativeToURL:(nullable NSURL *)baseURL;\n```\n\nConvenience initializer for creating a URL from a Unicode string, relative to another URL.\n\n-----\n\n© 2012–2022 Nate Weaver (Wevah)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwevah%2Fidna-cocoa","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwevah%2Fidna-cocoa","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwevah%2Fidna-cocoa/lists"}