mirror of
https://gitlab.gnome.org/GNOME/gimp.git
synced 2025-07-03 17:33:25 +00:00
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.
This commit is contained in:
parent
7e18e1f3f8
commit
db6dff283f
3 changed files with 42 additions and 11 deletions
|
@ -1,3 +1,10 @@
|
|||
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
|
||||
|
|
45
app/sanity.c
45
app/sanity.c
|
@ -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)
|
||||
{
|
||||
g_free (result);
|
||||
|
||||
return NULL;
|
||||
}
|
||||
else
|
||||
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 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;
|
||||
}
|
||||
|
||||
g_free (result);
|
||||
|
||||
result = g_filename_to_utf8 (gimp_directory (), -1, NULL, NULL, &error);
|
||||
|
||||
if (! result)
|
||||
{
|
||||
gchar *msg =
|
||||
g_strdup_printf
|
||||
(_("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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue