Function

GLibhostname_is_ascii_encoded

since: 2.22

Declaration

gboolean
g_hostname_is_ascii_encoded (
  const gchar* hostname
)

Description

Tests if hostname contains segments with an ASCII-compatible encoding of an Internationalized Domain Name. If this returns TRUE, you should decode the hostname with g_hostname_to_unicode() before displaying it to the user.

Note that a hostname might contain a mix of encoded and unencoded segments, and so it is possible for g_hostname_is_non_ascii() and g_hostname_is_ascii_encoded() to both return TRUE for a name.

Available since: 2.22

Parameters

hostname

Type: const gchar*

A hostname.

The data is owned by the caller of the function.
The value is a NUL terminated UTF-8 string.

Return value

Type: gboolean

TRUE if hostname contains any ASCII-encoded segments.