idnconv2(1) User Commands idnconv2(1)

idnconv2 - internationalized domain name converter

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

idnconv2 command is an internationalized domain name converter. idnconv2, which is provided as a part of idnkit version 2, supports IDNA2008 only. For IDNA2003, use idnconv in idnkit version 1.

idnconv2 reads text data, converts internationalized domain names in the 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) option, it decodes domain names (i.e. conversion from A-labels to U-labels).

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

idnconv2 can convert configuration files and zone master files for ISC BIND. See ``FILE MANAGEMENT'' for details.

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''.
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.
Specify the path of idnkit configuration file. If not specified, the default path (/etc/idn2.conf or ~/.idn2rc) is used, unless -noconf (or -C) option is specified.
Suppress reading a configuration file.
Specify decoder mode. idnconv2 runs in encoder mode, by default.
Use domain name registration protocol. This is the default behavior.
Use domain name lookup protocol.
Don't perform the ``map'' action. This is the same as ``-skip map''.
Skip actions. the following action names are recognized:
mappings
convert ASCII uppercase letters to lowercase
conversion from Punycode to Unicode for round trip check
prohibited code point check
unassigned code point check
NFC conformance check
ACE prefix check
hyphen check
combining character check
CONTEXTJ code point check
CONTEXTO code point check for domain name registration protocol.
CONTEXTO code point check for domain name lookup protocol.
Bidi check.
conversion to Punycode in encoder mode (conversion from Punycode in decoder mode)
label length check
round trip check
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.
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).
Force line-buffering mode.
Print which language, input encoding and output encoding will be chosen, if the same arguments are gievn to the command, and then quit immediately.
Print version information and quit.
Print help and quit.

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

idnconv2 performs conversion line by line. Here describes 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

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

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

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

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.

September 21, 2012 OmniOS