idnconv2(1)

πŸ“¦
version 2.3 Β· 2 versions
, in nixos 26.05

πŸ’– idnconv2(1) β€” General Commands Manual, but make it group-chat πŸ’–

🌸 NAME 🌸

idnconv2 β€” internationalized domain name converter, your fave IDN glow-up tool, no cap.

✨ SYNOPSIS ✨

idnconv2 [options..] [file...]

πŸ¦‹ DESCRIPTION πŸ¦‹

Okay bestie, so idnconv2 is an internationalized domain name converter. It comes as part of idnkit version 2 and supports IDNA2008 only. For IDNA2003, use idnconv in idnkit version 1 β€” different era, different icon.

idnconv2 reads text data, converts internationalized domain names inside that text, and outputs the converted text to standard out. If a file name is specified, idnconv2 reads the text data from the file. Otherwise, idnconv2 reads data from standard in.

By default, idnconv2 encodes domain names (i.e. conversion from U-labels to A-labels). Specifying -reverse (or -r) makes it decode domain names (i.e. conversion from A-labels to U-labels).

Unless -noconf (or -C) is given, idnconv2 reads a configuration file (/nix/store/hcyf58m2phm5bg6ch5a4lkif5fpf1lck-idnkit-2.3/etc/idn2.conf, ~/.idn2rc or a file specified by an option) and performs conversions according to the parameters specified in the file.

idnconv2 can also convert configuration files and zone master files for ISC BIND. See FILE MANAGEMENT for the details, bestie.

πŸ’… OPTIONS πŸ’…

  • -in in-code, -i in-code β€” specify the encoding name of the input text. Any of the following encoding names can be recognized:
    • Any encoding names which iconv_open() accepts
    • Punycode
    • UTF-8
    • Any alias names for the above, defined by the encoding alias file.

In encoder mode, the encoding defaults to the value of the environment variable IDN_LOCAL_CODESET or, if it is not set, an encoding determined from the locale information. In decoder mode, the encoding defaults to Punycode.

  • -out out-code, -o out-code β€” specify the encoding name of the output text. out-code can be any encoding name that can be specified for -in option.

In encoder mode, the encoding defaults to Punycode. In decoder mode, it defaults to the value of the environment variable IDN_LOCAL_CODESET or, if it is not set, an encoding determined from the locale information.

  • -conf file, -c file β€” specify the path of idnkit configuration file. If not specified, the default path (/nix/store/hcyf58m2phm5bg6ch5a4lkif5fpf1lck-idnkit-2.3/etc/idn2.conf or ~/.idn2rc) is used, unless -noconf (or -C) option is specified.
  • -noconf, -C β€” suppress reading a configuration file.
  • -reverse, -r β€” specify decoder mode. idnconv2 runs in encoder mode by default.
  • -registration, -g (default) β€” use domain name registration protocol. This is the default behavior.
  • -lookup, -l β€” use domain name lookup protocol.
  • -nomap, -M β€” don't perform the map action. This is the same as -skip map.
  • -skip action,... β€” skip actions. The following action names are recognized:
    • map β€” mappings
    • asclower β€” convert ASCII uppercase letters to lowercase
    • rtconv β€” conversion from Punycode to Unicode for round trip check
    • prohcheck β€” prohibited code point check
    • unascheck β€” unassigned code point check
    • nfccheck β€” NFC conformance check
    • prefcheck β€” ACE prefix check
    • hyphcheck β€” hyphen check
    • combcheck β€” combining character check
    • ctxjcheck β€” CONTEXTJ code point check
    • ctxocheck β€” CONTEXTO code point check for domain name registration protocol.
    • ctxolitecheck β€” CONTEXTO code point check for domain name lookup protocol.
    • bidicheck β€” Bidi check.
    • idnconv β€” conversion to Punycode in encoder mode (conversion from Punycode in decoder mode)
    • lencheck β€” label length check
    • rtcheck β€” round trip check
  • -whole, -w β€” assumes each input line represents an internationalized domain name. If this option is not specified, only non-ASCII characters and their surrounding texts will be converted. See ENCODER MODE and DECODER MODE for details.
  • -localcheck file, -e file β€” also perform local code point check using file. IDN registries define their own code point tables allowed for domain name registration. Using the local check feature, you can check whether a domain name consists of code points allowed by a particular registry. The format of file is explained in idn_setlocalcheckfile(3).
  • -flush β€” force line-buffering mode.
  • -test, -t β€” print which language, input encoding and output encoding will be chosen, if the same arguments are gievn to the command, and then quit immediately.
  • -version, -v β€” print version information and quit.
  • -help, -h β€” print help and quit.

🌈 LOCAL ENCODING 🌈

idnconv2 guesses local encoding from locale and environment variables. See the LOCAL ENCODING section in idn2.conf(5) for more details.

πŸŽ€ ENCODER MODE πŸŽ€

idnconv2 performs conversion line by line. Here's how idnconv2 does its job for each line.

  1. read a line from input text
  2. convert the line to UTF-8 idnconv2 converts the line from local encoding to UTF-8.
  3. find internationalized domain names If the -whole (or -w) option is specified, the entire line except for a new line character is assumed as an internationalized domain name. Otherwise, idnconv2 recognizes any character sequences having the following properties in the line as internationalized domain names.
    • containing at least one non-ASCII character, and
    • consisting of legal domain name characters (alphabets, digits, hyphens), non-ASCII characters and period.
  4. convert internationalized domain names For each internationalized domain name found in the line, idnconv2 converts the names to A-labels by applying the domain name registration or lookup protocol defined by IDNA2008-Protocol.
  5. output the result

πŸ“ DECODER MODE πŸ“

This is like the encoder mode, but they are not symmetric. idnconv2 does its job for each line.

  1. read a line from input text
  2. convert the line to UTF-8 idnconv2 converts the line from local encoding to UTF-8.
  3. find internationalized domain names If the -whole (or -w) option is specified, the entire line except for a new line character is assumed as an internationalized domain name. Otherwise, idnconv2 decodes any valid ASCII domain names including ACE names in the line.
  4. convert domain names to the local encoding For each internationalized domain name found in the line, idnconv2 converts the names to U-labels by applying the domain name registration or lookup protocol defined by IDNA2008-Protocol.
  5. output the result

🧚 FILE MANAGEMENT 🧚

Maybe the best way to manage named.conf or zone master files for ISC BIND that contains internationalized domain name is to keep them in your local encoding so that they can be edited with your favorite editor, and generate named.conf and master files of Punycode edition using idnconv2.

idnconv2 -in UTF-8 named.conf.utf8 > named.conf
idnconv2 -in UTF-8 example.com.zone.utf8 > example.com.zone

πŸ‘‘ SEE ALSO πŸ‘‘

idncheck(1), idncmp(1), iconv(3), idn2.conf(5), idnalias.conf(5), idnlang.conf(5)

πŸ’€ BUGS πŸ’€

The automatic input-code selection depends on your system, and sometimes it cannot guess or guess wrong. It is better to explicitly specify it using -in option.


Signing off from the General Commands Manual, dated Sep 21, 2012 β€” idnconv2(1) from idnkit version 2, out! πŸ«ΆπŸ’–

πŸ“¦ where this page comes from
  • nixos 26.05: idnkit 2.3
  • πŸ’– girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms