std/idna
On this page
Index
- type
IdnaErr- method
IdnaErr.display
- method
- type
Profile - fn
unicode_version - fn
to_ascii - fn
to_unicode
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".
IdnaErr.display
fn (e: IdnaErr) display() -> StrProfile
enum Profile {
Lookup
Registration
Display
Punycode
}x/net/idna’s profiles.
Functions
unicode_version
fn unicode_version() -> StrThe Unicode version of the tables (15.0.0).
to_ascii
fn to_ascii(domain: Str, p: Profile = Profile.Lookup) -> Str ! IdnaErrThe ASCII form of a domain name: each label that is not ASCII becomes
xn-- and its punycode.
to_unicode
fn to_unicode(domain: Str, p: Profile = Profile.Lookup) -> Str ! IdnaErrThe Unicode form of a domain name: each xn-- label decoded.