mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-03-14 19:55:12 +01:00
Merge branch '2514-charset-conundrum' into 'main'
tests: Unset CHARSET when testing locales to avoid it breaking tests Closes #2514 See merge request GNOME/glib!2369
This commit is contained in:
commit
e9eec6f1c8
@ -109,6 +109,12 @@ static gboolean
|
||||
g_utf8_get_charset_internal (const char *raw_data,
|
||||
const char **a)
|
||||
{
|
||||
/* Allow CHARSET to override the charset of any locale category. Users should
|
||||
* probably never be setting this — instead, just add the charset after a `.`
|
||||
* in `LANGUAGE`/`LC_ALL`/`LC_*`/`LANG`. I can’t find any reference (in
|
||||
* `git log`, code comments, or man pages) to this environment variable being
|
||||
* standardised or documented or even used anywhere outside GLib. Perhaps it
|
||||
* should eventually be removed. */
|
||||
const char *charset = g_getenv ("CHARSET");
|
||||
|
||||
if (charset && *charset)
|
||||
|
@ -3047,6 +3047,10 @@ main (gint argc,
|
||||
* Unset it to avoid interference with tests using setlocale and translation. */
|
||||
g_unsetenv ("LANGUAGE");
|
||||
|
||||
/* GLib uses CHARSET to allow overriding the character set used for all locale
|
||||
* categories. Unset it to avoid interference with tests. */
|
||||
g_unsetenv ("CHARSET");
|
||||
|
||||
g_test_init (&argc, &argv, NULL);
|
||||
|
||||
/* GDateTime Tests */
|
||||
|
Loading…
x
Reference in New Issue
Block a user