talira

idna (Erlang)

A pure Erlang IDNA implementation for internationalised domain names

open sourceMITfree

idna converts internationalised domain names between Unicode and their ASCII (Punycode) form in pure Erlang, following IDNA 2008 (RFC 5891), with UTS #46 compatibility processing and IDNA 2003 transitional mapping. It validates labels (NFC normalisation, hyphen placement, combining marks, contextual and bidirectional rules) and works from Elixir through Mix as well as from rebar3. It isn't the Python idna package.

Problems it solves

  • turn a domain name with accented or non-Latin characters into its xn-- form in Erlang
  • decode Punycode hostnames back to Unicode in an Elixir app
  • validate an internationalised domain name before using it

Features

  • IDNA 2008 encoding and decoding (RFC 5891)
  • UTS #46 compatibility processing, with IDNA 2003 transitional mapping
  • label validation: NFC, hyphen placement, leading combining marks, CONTEXTJ/CONTEXTO and bidirectional rules (RFC 5893)
  • usable from Erlang (rebar3) and Elixir (Mix)