idna-cli

Crates.ioidna-cli
lib.rsidna-cli
version
sourcesrc
created_at2023-08-21 17:40:11.420841
updated_at2024-12-04 14:07:31.48143
descriptionEncode/decode Unicode domain names to/from IDNA ASCII
homepage
repositoryhttps://github.com/qtfkwk/idna-cli
max_upload_size
id950240
Cargo.toml error:TOML parse error at line 17, column 1 | 17 | autolib = false | ^^^^^^^ unknown field `autolib`, expected one of `name`, `version`, `edition`, `authors`, `description`, `readme`, `license`, `repository`, `homepage`, `documentation`, `build`, `resolver`, `links`, `default-run`, `default_dash_run`, `rust-version`, `rust_dash_version`, `rust_version`, `license-file`, `license_dash_file`, `license_file`, `licenseFile`, `license_capital_file`, `forced-target`, `forced_dash_target`, `autobins`, `autotests`, `autoexamples`, `autobenches`, `publish`, `metadata`, `keywords`, `categories`, `exclude`, `include`
size0
(qtfkwk)

documentation

README

About

Encode/decode Unicode domain names to/from IDNA ASCII

Usage

$ idna -h
Encode/decode Unicode domain names to/from IDNA ASCII

Usage: idna [OPTIONS] [DOMAINS]...

Arguments:
  [DOMAINS]...  One or more domains

Options:
  -d, --decode           Decode IDNA ASCII input to Unicode
  -f, --files <FILES>    One or more files
  -o, --output <FORMAT>  Output format (csv, json, json-pretty, rust,
                         rust-pretty) [default: csv]
  -h, --help             Print help
  -V, --version          Print version
$ idna -V
idna 0.2.1

Examples

Encode

$ idna goögle.com
"Unicode","ASCII","Errors"
"goögle.com","xn--gogle-kua.com",""

Decode

$ idna -d xn--gogle-kua.com
"ASCII","Unicode","Errors"
"xn--gogle-kua.com","goögle.com",""

Files

$ idna -f unicode.txt
"Unicode","ASCII","Errors"
"goögle.com","xn--gogle-kua.com",""
$ idna -df ascii.txt
"ASCII","Unicode","Errors"
"xn--gogle-kua.com","goögle.com",""

JSON output

$ idna goögle.com -o json
{"Arguments":{"goögle.com":{"ascii":"xn--gogle-kua.com","unicode":"goögle.com","errors":""}}}
$ idna -d xn--gogle-kua.com -o json
{"Arguments":{"xn--gogle-kua.com":{"ascii":"xn--gogle-kua.com","unicode":"goögle.com","errors":""}}}
$ idna goögle.com -o json-pretty
{
  "Arguments": {
    "goögle.com": {
      "ascii": "xn--gogle-kua.com",
      "unicode": "goögle.com",
      "errors": ""
    }
  }
}
$ idna -d xn--gogle-kua.com -o json-pretty
{
  "Arguments": {
    "xn--gogle-kua.com": {
      "ascii": "xn--gogle-kua.com",
      "unicode": "goögle.com",
      "errors": ""
    }
  }
}

Files to JSON

$ idna -f unicode.txt -o json
{"File: \"unicode.txt\"":{"goögle.com":{"ascii":"xn--gogle-kua.com","unicode":"goögle.com","errors":""}}}
$ idna -df ascii.txt -o json
{"File: \"ascii.txt\"":{"xn--gogle-kua.com":{"ascii":"xn--gogle-kua.com","unicode":"goögle.com","errors":""}}}
$ idna -f unicode.txt -o json-pretty
{
  "File: \"unicode.txt\"": {
    "goögle.com": {
      "ascii": "xn--gogle-kua.com",
      "unicode": "goögle.com",
      "errors": ""
    }
  }
}
$ idna -df ascii.txt -o json-pretty
{
  "File: \"ascii.txt\"": {
    "xn--gogle-kua.com": {
      "ascii": "xn--gogle-kua.com",
      "unicode": "goögle.com",
      "errors": ""
    }
  }
}
Commit count: 9

cargo fmt