idn2.conf(5)
π idn2.conf(5) β the file formats manual, but make it make sense π
okay so bestie, this is a page from the File Formats Manual and it's literally all about idn2.conf and .idn2rc β the config files for idnkit version 2. yes it's a manual page, no it's not boring, let's go β¨
β¨ NAME β¨
idn2.conf, .idn2rc β the configuration files for idnkit version 2 π
π¦ SYNOPSIS π¦
/nix/store/hcyf58m2phm5bg6ch5a4lkif5fpf1lck-idnkit-2.3/etc/idn2.conf
~/.idn2rc
πΈ DESCRIPTION πΈ
So. idn2.conf and .idn2rc are the default configuration files for the idnkit library version 2 β which is, like, a whole toolkit for handling internationalized domain names. π
idnkit version 2 supports IDNA2008 only, periodt. If you want IDNA2003, you gotta use idnkit version 1, no cap. idnkit version 2 also supports UTS #46, but it's restrictive and experimental (peep the UTS #46 SUPPORT section below π).
Here's the vibe check on how it loads:
- If an application explicitly specifies a path to the configuration file, the idnkit library tries to read that file.
- Otherwise, it tries to load the user's config file
~/.idn2rcfirst, and then it tries the system config file/nix/store/hcyf58m2phm5bg6ch5a4lkif5fpf1lck-idnkit-2.3/etc/idn2.conf.
π important: the idnkit library loads either, not both. it's giving "pick one, bestie."
And if there's no default configuration file on the system at all? The idnkit library just assumes the config file is empty. iconic, honestly. π«Ά
π§ SYNTAX π§
The config file is a simple text file. Each line β other than comment lines (which begin with #) and empty lines β forms an entry in this format:
keyword value..
that's it. that's the whole format. slay. π
π LANGUAGE ENTRY π
The language entry specifies the "current language". The current language is what the idnkit library uses when it performs lowercase conversion (check MAP ENTRY) and language-based local mapping (check LANGUAGE-LOCAL ENTRY). π
- The entry can be specified only once.
- If the entry is not specified, the library determines the current language from locale information.
syntax):
language language
language must be an ISO639 language code. Both ISO639-1 (e.g. en for English) and ISO639-2 (e.g. eng) codes are recognized. π
π₯ MAP ENTRY π₯
The map entry specifies mapping procedures. Unlike IDNA2003, IDNA2008 doesn't define explicit mapping procedures β so the idnkit library performs mapping procedures according to this entry. main character energy tbh.
syntax):
map procedure ...
The following procedures are currently available β and yes, I'm listing all of them, because we don't skip:
lowercaseβ Map uppercase letters to lowercase.widthβ Decompose full-width and half-width characters.nfcβ Unicode Normalization Form C.nfkcβ Unicode Normalization Form KC.delimitermapβ Map specific characters to.(U+002E; FULL STOP).tr46-mapβ UTS #46 non-transitional mapping.tr46-map-deviationβ UTS #46 transitional mapping.tr46-checkβ UTS #46 non-transitional validation.tr46-check-deviationβ UTS #46 transitional validation.language-localβ Language based local mapping.tld-localβ TLD based local mapping.rfc5895β Applylowercase,width,nfcanddelimitermapin that order.resman-idna2008-mappings-01β Same asrfc5895.tr46-processingβ Applytr46-map,nfcandtr46-checkin that order.tr46-processing-deviationβ Applytr46-map-deviation,nfcandtr46-check-deviationin that order.
The procedures are executed in the order listed in the entry. And yes, the same procedure can be specified twice or more β why not. Suppose map nfc language-local nfc is specified: idnkit does Unicode Normalization Form C, then language based local mapping, and then performs NFC again. two nfc's, one vibe. π
- The entry can be specified only once.
- If the entry is not specified, the library supposes that this:
map rfc5895 language-local nfc
is specified. π
β DELIMITERS ENTRY β
delimiters specifies code points which should be mapped to . (U+002E; FULL STOP) at delimitermap. πΈ
π heads up: the mapping is applied only whendelimitermapis specified in amapentry.
syntax):
delimitermap code-point ...
okay so code-point is a hexadecimal integer of a Unicode code point of a delimiter (e.g. 3002), and it can be preceded by U+ (e.g. U+3002). cute. π
- The entry can be specified only once.
- If the entry is not specified, the library assumes
"3002"is specified.
π LANGUAGE-LOCAL ENTRY π
The language-local entry specifies language based local mapping. π¦
π reminder: this mapping procedure is applied only whenlanguage-localis specified in amapentry.
syntax):
language-local language map-file
If the current language matches language, the mapping specified by map-file is performed. Otherwise? no mappings. zero. nada. π«Ά
language must be an ISO639 language code. Both ISO639-1 (e.g. en for English) and ISO639-2 (e.g. eng) codes are recognized.
A local mapping with * as language is a default mapping. So when the current language doesn't match any languages of the language-local entries, the default mapping is applied. β¨
π TLD-LOCAL ENTRY π
The tld-local entry specifies TLD (top level domain) based local mapping. π
π reminder: the mapping is applied only whentld-localis specified in amapentry.
syntax):
tld-local tld map-file
If a TLD of a domain name matches tld, the mapping specified by map-file is performed on the domain name. Otherwise, no mappings. again. π«
- If
tldis*, mapping is applied to domain names whose TLD does not match any TLDs specified intld-localentries. - If
tldis-, the mapping is applied to domain names without any dots.
For backward compatibility to idnkit version 1.0, the entry name local-map can be used instead of tld-local. π The entry can be defined multiple times. β¨
π§ LOCAL ENCODING π§
idn2.conf or ~/.idn2rc doesn't have an entry to specify the local encoding β because it's determined from the application's current locale information. That is to say, each application can use a different local encoding. iykyk. π
Though idnkit tries hard to find out the local encoding, sometimes it fails. π For example, there are applications which use non-ASCII encoding but work in C locale. In this case, you can specify the application's local encoding with the environment variable IDN_LOCAL_CODESET. Just set the encoding name (or its alias name) to the variable, and idnkit will use that encoding as the local one, regardless of the locale setting. obsessed. π₯
π UTS #46 SUPPORT π
idnkit version 2 also supports UTS (Unicode Technical Standard) #46, but it's restrictive, since the goal of idnkit version 2 is to support IDNA2008. π
idnkit version 2 provides four mapping procedures for UTS #46:
tr46-maptr46-map-deviationtr46-checktr46-check-deviation
Input of the mapping procedure is a whole domain name β not a list of labels β and the domain name may contain A-labels. β οΈ
tr46-check and tr46-check-deviation themselves don't split the domain name into labels or convert A-labels in it to U-labels. That is to say, idnkit cannot apply tr46-check or tr46-check-deviation to A-labels. no cap, that's just how it is. π
π¦ SAMPLE CONFIGURATION π¦
The following shows a sample configuration file β literally copy this energy:
#
# a sample configuration.
#
# The current language.
language ja
# Mapping procedures.
map lowercase width nfc delimitermap language-local nfc
# Register delimiters
delimiters 3002 ff0e ff61
# Register language-specific mappings for Japanese and Turkish.
language-local ja /usr/local/share/idnkit/map/ja.map
language-local tr /usr/local/share/idnkit/map/tr.map
ate. π
π FILES π
/nix/store/hcyf58m2phm5bg6ch5a4lkif5fpf1lck-idnkit-2.3/etc/idn2.conf~/.idn2rc/nix/store/hcyf58m2phm5bg6ch5a4lkif5fpf1lck-idnkit-2.3/etc/idn2.conf.sampleβ sample configuration with comments π
π SEE ALSO π
idncheck(1), idncmp(1), idnconv2(1), iconv(3), libidnkit(3), idnalias.conf(5), idnlang.conf(5)
and that's the whole page bestie π«Ά β this one's from idnkit 2.3 (that's the source/version, keep it in your notes π) and it's dated Sep 21, 2012. older than most of my fave playlists but she still slays β¨ππ
π¦ 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