IdnHostname class

Validates IDN hostnames with a best-effort Unicode label check.

This is a pragmatic best-effort validator (not full IDNA 2008 / Punycode conformance). It accepts ASCII hostnames and hostnames whose labels contain Unicode letters or digits while still enforcing the RFC 1123 structural rules (label length, total length, no leading/trailing hyphen).

Example:

IdnHostname.isValid('example.com');   // true
IdnHostname.isValid('münchen.de');    // true  (best-effort: unicode label)
IdnHostname.isValid('-bad.com');      // false (leading hyphen)
IdnHostname.isValid('a' * 64 + '.com'); // false (label too long)

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

isValid(String value) bool
Returns true if value is a valid IDN hostname (best-effort check).