$Id: idn.conf.5.in,v 1.1 2003/06/04 00:27:16 marka Exp $"

Copyright (c) 2000,2001 Japan Network Information Center.
All rights reserved.

By using this file, you agree to the terms and conditions set forth bellow.

LICENSE TERMS AND CONDITIONS

The following License Terms and Conditions apply, unless a different
license is obtained from Japan Network Information Center ("JPNIC"),
a Japanese association, Kokusai-Kougyou-Kanda Bldg 6F, 2-3-4 Uchi-Kanda,
Chiyoda-ku, Tokyo 101-0047, Japan.

1. Use, Modification and Redistribution (including distribution of any
modified or derived work) in source and/or binary forms is permitted
under this License Terms and Conditions.

2. Redistribution of source code must retain the copyright notices as they
appear in each source code file, this License Terms and Conditions.

3. Redistribution in binary form must reproduce the Copyright Notice,
this License Terms and Conditions, in the documentation and/or other
materials provided with the distribution. For the purposes of binary
distribution the "Copyright Notice" refers to the following language:
"Copyright (c) 2000-2002 Japan Network Information Center. All rights reserved."

4. The name of JPNIC may not be used to endorse or promote products
derived from this Software without specific prior written approval of
JPNIC.

5. Disclaimer/Limitation of Liability: THIS SOFTWARE IS PROVIDED BY JPNIC
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JPNIC BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.

idn.conf 5 "Mar 8, 2002"

NAME
idn.conf, .idnrc, idnalias.conf - configuration files for idnkit library
SYNOPSIS
@sysconfdir@/idn.conf

~/.idnrc

@sysconfdir@/idnalias.conf

DESCRIPTION
idn.conf and .idnrc are configuration files for idnkit library which is a toolkit for handling internationalized domain names.

idnkit library tries to load the user's configuration file ~/.idnrc first, and then tries the system configutation file @sysconfdir@/idn.conf. Note that idnkit library loads either, not both.

To use internationalized domain names in DNS or other protocols, they must be converted to an appropriate format before further processing. In idnkit, this conversion process is comprised of the following tasks.

1. 3
Convert the given domain name in application's local codeset to Unicode, and vice versa.
2. 3
Map certain characters in the name to period character so that they are treated as the domain name delimiter (delimiter mapping).
3. 3
Map certain characters in the name to other characters or chracter sequences, according to a mapping rule determined by its top level domain (TLD).
4. 3
Perform NAMEPREP, which is a starndard name preparation process for internationalized domain names. This process is composed of the tree steps called mapping, normalization, prohibited character checking and bidirectional string checking.
5. 3
Convert the nameprepped name to IDN encoding, which is the standard encoding for internationalized domain names (also known as ASCII-compatible encoding, ACE), and vice versa.

The configuration file specifies the parameters for these tasks, such as:

- 2
the encoding of internationalized domain names (IDN encoding).
- 2
NAMEPREP schemes.

SYNTAX
The configuration file is a simple text files, and each line in the file (other than comment lines, which begin with ``#'', and empty lines) forms an entry of the following format:

keyword value..
\."
"IDN-ENCODING ENTRY"
IDN encoding entry specifies the encoding name (codeset name) which is used as the encoding of internationalized domain names.

The syntax of this entry is:

idn-encoding encoding

encoding is the encoding name to be used, and any of the following names can be specified.

"\(bu" 2
``Punycode''
"\(bu" 2
``UTF-8''
"\(bu" 2
Codeset names which iconv_open() library function accepts. Please consult iconv() documentation for the available codesets.
"\(bu" 2
Any alias names for the above, defined by the alias file. (See section ``ENCODING-ALIAS-FILE'')

The standard encoding was determined as Punycode.

"NAMEPREP ENTRY"
Nameprep entry specifies the version of NAMEPREP, which is a specification of ``canonicalization'' process of internationalized domain name before it is converted to the IDN encoding.

The syntax of this entry is:

nameprep version

version is the version name of NAMEPREP specification, and currently the following versions can be specified.

"\(bu" 2
``RFC3491''

This version refers to RFC3491 ``rfc-3491.txt''.

The NAMEPREP process consists of the following 4 subprocesses.

1. 3
mapping, which maps certain characters in a name to other characters, possibly none.
2. 3
normalization, which replaces character variants in a name to a unique one.
3. 3
prohibited character checking, which detects invalid characters in a name.
4. 3
unassigned codepoint checking, which also invalid codepoints in a name.
5. 3
bidirectional string checking, which detecs invalid string.
"LOCAL-MAP ENTRY"
This entry specifies localized mapping phase before NAMEPREP takes place. Different mapping rules can be specified for each TLD (top-level domain). For example, you can have one mapping for ``.tw'' domain, and another for ``.jp'' domain.

The syntax of this entry is:

local-map tld scheme [scheme..]

tld specifies the TLD to which the mapping rule is to be applied, and scheme specifies the mapping scheme, and currently available schemes are:

4 RFC3491 Specify mapping defined by RFC3491.

4 filemap:pathname Specify mapping defined by the file pathname. See ``MAPFILE FORMAT'' for the format of this file.

There are two special tlds for specifying the mapping rule for local domain names (domain names without any dots in them), and the default mapping rule. If tld is ``-'', it matches domain names which do not contain any dots. If tld is ``.'', it matches any domain names which don't match to any other mapping rules specified by ``local-map'' entries.

"MAPFILE FORMAT"
A mapfile defines a set of character mapping rules. It can define unconditional one-character to N-character-sequence (N can be 0, 1 or more) mappings.

A mapfile is a simple text file, and each line specifies a single mapping. Each line is of the form:

src-codepoint; mapped-codepoint-seq;

src-codepoint indicates source character of the mapping, and must be a Unicode codepoint value in hexadecimal string. mapped-codepoint-seq is a sequence of characters which is the outcome of the mapping, and must be a (possibly empty) list of Unicode codepoint values in hexadecimal string, separated by spaces.

Lines which begin with ``#'' are treated as comments and ignored.

A sample mapfile is shown below.

# map "A" to "a"
0041; 0061;
# map "#" to nothing
0023; ;
# map "@" to "at"
0040; 0061 0074;

"LOCAL CODESET"
idn.conf or ~/.idnrc doesn't have an entry to specify the local codeset, since it is determined from the application's current locale information. So each application can use different local codeset.

Although idnkit tries hard to find out the local codeset, sometimes it fails. For example, there are applications which use non-ASCII codeset but work in C locale. In this case, you can specify the application's local codeset by an environment variable ``IDN_LOCAL_CODESET''. Just set the codeset name (or its alias name) to the variable, and idnkit will use the codeset as the local one, regardless of the locale setting.

"ENCODING-ALIAS-FILE"
Encoding alias file specifies codeset name aliases. It is located on @sysconfdir@/idnalias.conf and always loaded automatically as idn.conf and .idnrc. The aliases in this file can be used just as the real names.

The alias file is a simple text file, consisting of lines of the form:

alias-name name

alias-name is the alias name to be defined, and name is the real name or another alias name.

"SAMPLE CONFIGURATION"
The following shows a sample configuration file.

#
# a sample configuration.
#

# Use Punycode as the IDN encoding.
idn-encoding Punycode

# Use RFC3491 as NAMEPREP.
nameprep RFC3491

# Perform Japanese-specific mapping for .jp domain.
# assuming /usr/local/lib/idnkit/jp-map contains the mapping.
local-map .jp filemap:/usr/local/lib/idnkit/jp-map

FILES
@sysconfdir@/idn.conf

~/.idnrc

@sysconfdir@/idnalias.conf

@sysconfdir@/idn.conf.sample - sample configuration with comments

@sysconfdir@/idnalias.conf.sample - sample alias file

"SEE ALSO"
iconv(3)