GNU IDN Library - Libidn
Introduction
GNU Libidn is a fully documented implementation of the Stringprep, Punycode and IDNA 2003 specifications. Libidn's purpose is to encode and decode internationalized domain names. The native C, C# and Java libraries are available under the GNU Lesser General Public License version 2.1 or later.
Please be aware that GNU libidn2 is the successor of GNU libidn. It comes with IDNA 2008 and TR46 implementation and also provides a compatibility layer for GNU libidn.
The library contains a generic Stringprep implementation. Profiles for Nameprep, iSCSI, SASL, XMPP and Kerberos V5 are included. Punycode and ASCII Compatible Encoding (ACE) via IDNA are supported. A mechanism to define Top-Level Domain (TLD) specific validation tables, and to compare strings against those tables, is included. Default tables for some TLDs are also included.
The Stringprep API consists of two main functions, one for converting data from the system's native representation into UTF-8, and one function to perform the Stringprep processing. Adding a new Stringprep profile for your application within the API is straightforward. The Punycode API consists of one encoding function and one decoding function. The IDNA API consists of the ToASCII and ToUnicode functions, as well as an high-level interface for converting entire domain names to and from the ACE encoded form. The TLD API consists of one set of functions to extract the TLD name from a domain string, one set of functions to locate the proper TLD table to use based on the TLD name, and core functions to validate a string against a TLD table, and some utility wrappers to perform all the steps in one call.
The library is used by, e.g., GNU SASL and Shishi to process user names and passwords. Libidn can be built into GNU Libc to enable a new system-wide getaddrinfo flag for IDN processing.
Libidn is developed for the GNU/Linux system, but runs on over 20 Unix platforms (including Solaris, IRIX, AIX, and Tru64) and Windows. The library is written in C and (parts of) the API is also accessible from C++, Emacs Lisp, Python and Java. A native Java and C# port is included.
Also included is a command line tool, several self tests, code examples, and more, all licensed under the GNU General Public License version 3.0 or later.
Table of Contents
- Introduction
- News
- Try it
- Documentation
- Downloading
- Support
- Development
- Bugs
- Related implementations
- How to use it?
- Libidn2
News
Note that new releases are only mentioned here if they introduce a major feature or is significant in some other way. Read the help-libidn mailing list if you seek more frequent announcements.
- 2012-01-10: An infloop bug was fixed for the pr29 functions. The library has been relicensed to dual-GPLv2+|LGPLv3+. See the Libidn 1.24 announcement.
- 2011-05-04: Quality Assurance improvements: we publish clang-analyzer reports for the library.
- 2011-04-20: An IDNA2008 implementation is announced called libidn2.
- 2008-10-07: Quality Assurance improvements: we publish cyclomatic code Complexity charts and self-test code coverage charts.
- 2007-07-31: Version 1.0 is released, to indicate that Libidn is now considered stable. It has been used in production for several years with only minor issues found.
- 2007-05-31: Libidn is now developed in git instead of cvs, there is a public savannah git repository.
- 2006-06-07: Translation of error messages are working, and the library has been ported to Windows using MinGW.
- 2005-12-03: Version 0.6.0 include a native C# port, contributed by Alexander Gnauck.
- 2004-11-08: GNU/Linux distribution Fedora Core 3 includes Libidn version 0.5.6.
- 2004-10-02: Version 0.5.6 include functions
(e.g.,
idna_strerror
) to translate from return codes to human readable text strings. - 2004-06-26: Version 0.5.0 include a module to detect "problem sequences" for normalization as discussed in PR-29.
- 2004-06-01: Version 0.4.8 include a native Java port, thanks to Oliver Hitz.
- 2004-04-30: People interested in the specifications behind libidn may be interested in a proposed change to NFKC by the Unicode Consortium. I have posted a message to the IDN WG mailing list asking for opinions on this, but apparently the list moderator is ignoring it.
- 2004-03-27: Recently a patch to GNU