Xo is experimental. The source is now public on GitHub, or try Xo in your browser.
Menu · idna

Docs

std/idna

On this page

Index

Types

IdnaErr

struct IdnaErr {
  code: Str
  msg: Str
}

Why a name was rejected. code is the UTS 46 status code x/net/idna reports (P1 a disallowed rune, V2 and V3 hyphens, C a joiner, B the Bidi rule, A3 and P4 punycode, A4 length, …) and msg its text, for example idna: invalid label "-a".

Source: std/idna.xo:9

IdnaErr.display

fn (e: IdnaErr) display() -> Str

Source: std/idna.xo:14

Profile

enum Profile {
  Lookup
  Registration
  Display
  Punycode
}

x/net/idna’s profiles.

Source: std/idna.xo:17

Functions

unicode_version

fn unicode_version() -> Str

The Unicode version of the tables (15.0.0).

Source: std/idna.xo:32

to_ascii

fn to_ascii(domain: Str, p: Profile = Profile.Lookup) -> Str ! IdnaErr

The ASCII form of a domain name: each label that is not ASCII becomes xn-- and its punycode.

Source: std/idna.xo:36

to_unicode

fn to_unicode(domain: Str, p: Profile = Profile.Lookup) -> Str ! IdnaErr

The Unicode form of a domain name: each xn-- label decoded.

Source: std/idna.xo:38

↑ index