idnconv2(1)
π 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 π
-inin-code,-iin-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 PunycodeUTF-8- Any alias names for the above, defined by the encoding alias file.
- Any encoding names which
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.
-outout-code,-oout-code β specify the encoding name of the output text. out-code can be any encoding name that can be specified for-inoption.
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.
-conffile,-cfile β specify the path of idnkit configuration file. If not specified, the default path (/nix/store/hcyf58m2phm5bg6ch5a4lkif5fpf1lck-idnkit-2.3/etc/idn2.confor~/.idn2rc) is used, unless-noconf(or-C) option is specified.-noconf,-Cβ suppress reading a configuration file.-reverse,-rβ specify decoder mode.idnconv2runs 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 themapaction. This is the same as-skip map.-skip action,...β skip actions. The following action names are recognized:mapβ mappingsasclowerβ convert ASCII uppercase letters to lowercasertconvβ conversion from Punycode to Unicode for round trip checkprohcheckβ prohibited code point checkunascheckβ unassigned code point checknfccheckβ NFC conformance checkprefcheckβ ACE prefix checkhyphcheckβ hyphen checkcombcheckβ combining character checkctxjcheckβ CONTEXTJ code point checkctxocheckβ 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 checkrtcheckβ 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. SeeENCODER MODEandDECODER MODEfor details.-localcheckfile,-efile β 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 inidn_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.
- read a line from input text
- convert the line to UTF-8
idnconv2converts the line from local encoding to UTF-8. - 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,idnconv2recognizes 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.
- convert internationalized domain names For each internationalized domain name found in the line,
idnconv2converts the names to A-labels by applying the domain name registration or lookup protocol defined by IDNA2008-Protocol. - output the result
π DECODER MODE π
This is like the encoder mode, but they are not symmetric. idnconv2 does its job for each line.
- read a line from input text
- convert the line to UTF-8
idnconv2converts the line from local encoding to UTF-8. - 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,idnconv2decodes any valid ASCII domain names including ACE names in the line. - convert domain names to the local encoding For each internationalized domain name found in the line,
idnconv2converts the names to U-labels by applying the domain name registration or lookup protocol defined by IDNA2008-Protocol. - 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
- Copyright (c) 2000-2002 Japan Network Information Center. All rights reserved
- Copyright (c) 2000-2002 Japan Network Information Center. All rights reserved."
- Copyright (c) 2010-2012 Japan Registry Services Co., Ltd. All rights reserved."
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms