tests: Ensure gettext strings are loaded in UTF-8 in gdatetime.c

See the previous commit. By convention, GLib assumes strings loaded from
gettext are always in UTF-8, but we do need to tell gettext this. In
most other tests, it doesn’t matter; but in the gdatetime test, we test
re-encoding month names from EUC-JP, so we need to ensure the
translations start in UTF-8 correctly.

Signed-off-by: Philip Withnall <withnall@endlessm.com>

https://bugzilla.gnome.org/show_bug.cgi?id=793578
This commit is contained in:
Philip Withnall 2018-02-20 13:27:50 +00:00
parent 12f11090dc
commit 36af567045

View File

@ -20,6 +20,7 @@
#include <string.h>
#include <time.h>
#include <gi18n.h>
#include <glib.h>
#include <glib/gstdio.h>
#include <locale.h>
@ -2276,6 +2277,7 @@ main (gint argc,
g_test_bug_base ("http://bugzilla.gnome.org/");
/* GDateTime Tests */
bind_textdomain_codeset ("glib20", "UTF-8");
g_test_add_func ("/GDateTime/invalid", test_GDateTime_invalid);
g_test_add_func ("/GDateTime/add_days", test_GDateTime_add_days);