hostnameIsNonAscii

fnbool hostnameIsNonAscii(string hostname)

Tests if hostname contains Unicode characters. If this returns true, you need to encode the hostname with glib.global.hostnameToAscii before using it in non-IDN-aware contexts.

Note that a hostname might contain a mix of encoded and unencoded segments, and so it is possible for glib.global.hostnameIsNonAscii and glib.global.hostnameIsAsciiEncoded to both return true for a name.

Parameters

hostnamea hostname

Returns

true if hostname contains any non-ASCII characters