GLib.hostname_is_non_ascii
function hostname_is_non_ascii(hostname: String): Boolean { // Gjs wrapper for g_hostname_is_non_ascii() }
Tests if hostname contains Unicode characters. If this returns true, you need to encode the hostname with GLib.hostname_to_ascii 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.hostname_is_non_ascii and GLib.hostname_is_ascii_encoded to both return true for a name.
Since 2.22
- hostname
a hostname
- Returns
true if hostname contains any non-ASCII characters