abort if the configured filename encoding can't be converted to UTF-8.
2004-08-07 Sven Neumann <sven@gimp.org> * app/sanity.c: abort if the configured filename encoding can't be converted to UTF-8. Fixes bug #149464 for the HEAD branch.
This commit is contained in:

committed by
Sven Neumann

parent
5ebbc4d68f
commit
d1d7cb4c0d
@ -1,3 +1,8 @@
|
||||
2004-08-07 Sven Neumann <sven@gimp.org>
|
||||
|
||||
* app/sanity.c: abort if the configured filename encoding can't be
|
||||
converted to UTF-8. Fixes bug #149464 for the HEAD branch.
|
||||
|
||||
2004-08-07 Sven Neumann <sven@gimp.org>
|
||||
|
||||
* libgimp/gimpgradientmenu.c (gimp_gradient_select_preview_expose):
|
||||
|
37
app/sanity.c
37
app/sanity.c
@ -25,6 +25,9 @@
|
||||
#include "sanity.h"
|
||||
|
||||
|
||||
static gchar * sanity_check_filename_encoding (void);
|
||||
|
||||
|
||||
const gchar *
|
||||
sanity_check (void)
|
||||
{
|
||||
@ -121,5 +124,39 @@ sanity_check (void)
|
||||
}
|
||||
#endif
|
||||
|
||||
if (! abort_message)
|
||||
abort_message = sanity_check_filename_encoding ();
|
||||
|
||||
return abort_message;
|
||||
}
|
||||
|
||||
|
||||
static gchar *
|
||||
sanity_check_filename_encoding (void)
|
||||
{
|
||||
gchar *result;
|
||||
GError *error = NULL;
|
||||
|
||||
result = g_filename_to_utf8 ("foobar", -1, NULL, NULL, &error);
|
||||
|
||||
if (result)
|
||||
{
|
||||
g_free (result);
|
||||
|
||||
return NULL;
|
||||
}
|
||||
else
|
||||
{
|
||||
gchar *msg =
|
||||
g_strdup_printf
|
||||
("The configured filename encoding cannot be converted to UTF-8: "
|
||||
"%s\n\n"
|
||||
"Please check the value of the environment variable "
|
||||
"G_FILENAME_ENCODING.",
|
||||
error->message);
|
||||
|
||||
g_error_free (error);
|
||||
|
||||
return msg;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user