mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-07-30 05:43:28 +02:00
g_get_host_name: ensure hostname has UTF8 encoding on Windows
Ensures that the hostname returned by g_get_host_name is always UTF8 encoded. Previously, on Windows, the returned string would be encoded in the current codepage, if it contained non-ASCII characters. The unit test for g_get_host_name was updated with a check to ensure that the hostname is indeed at UTF-8 string. https://bugzilla.gnome.org/show_bug.cgi?id=789755
This commit is contained in:
committed by
Philip Withnall
parent
41112ef00d
commit
d011223085
@@ -391,6 +391,7 @@ test_hostname (void)
|
||||
name = g_get_host_name ();
|
||||
|
||||
g_assert (name != NULL);
|
||||
g_assert_true (g_utf8_validate (name, -1, NULL));
|
||||
}
|
||||
|
||||
#ifdef G_OS_UNIX
|
||||
|
Reference in New Issue
Block a user