Commit db6dff28 authored by Sven Neumann's avatar Sven Neumann Committed by Sven Neumann

try to convert the result of gimp_directory() to UTF-8 and bail out with a

2004-08-26  Sven Neumann  <sven@gimp.org>

	* app/sanity.c (sanity_check_filename_encoding): try to convert
	the result of gimp_directory() to UTF-8 and bail out with a
	moderately helpful error message if this conversion fails. Works
	around bug #150917. Also marked these strings for translation.
parent 7e18e1f3
2004-08-26 Sven Neumann <sven@gimp.org>
* app/sanity.c (sanity_check_filename_encoding): try to convert
the result of gimp_directory() to UTF-8 and bail out with a
moderately helpful error message if this conversion fails. Works
around bug #150917. Also marked these strings for translation.
2004-08-26 Sven Neumann <sven@gimp.org>
* app/tools/gimp-tools.c (gimp_tools_register): set the paintbrush
......
......@@ -22,8 +22,12 @@
#include <fontconfig/fontconfig.h>
#include <pango/pangoft2.h>
#include "libgimpbase/gimpenv.h"
#include "sanity.h"
#include "gimp-intl.h"
static gchar * sanity_check_filename_encoding (void);
......@@ -139,24 +143,43 @@ sanity_check_filename_encoding (void)
result = g_filename_to_utf8 ("", -1, NULL, NULL, &error);
if (result)
if (! result)
{
g_free (result);
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 NULL;
return msg;
}
else
g_free (result);
result = g_filename_to_utf8 (gimp_directory (), -1, NULL, NULL, &error);
if (! result)
{
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.",
(_("The name of the directory holding the GIMP user configuration "
"cannot be converted to UTF-8: "
"%s\n\n"
"Most probably your filesystem stores files in an encoding "
"different from UTF-8 and you didn't tell GLib about this. "
"Please set the environment variable G_FILENAME_ENCODING."),
error->message);
g_error_free (error);
return msg;
}
g_free (result);
return NULL;
}
......@@ -3,6 +3,7 @@
app/app_procs.c
app/main.c
app/sanity.c
app/actions/actions.c
app/actions/brushes-actions.c
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment