idnconv2(1)

NAME
idnconv2 - internationalized domain name converter

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

DESCRIPTION
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.

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 (/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 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

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.