is_non_ascii


Description:

public bool is_non_ascii (string hostname)

Tests if hostname contains Unicode characters.

If this returns true, you need to encode the hostname with 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 is_non_ascii and is_ascii_encoded to both return true for a name.

Parameters:

hostname

a hostname

Returns:

true if hostname contains any non-ASCII characters


Namespace: GLib.Hostname
Package: glib-2.0