diff --git a/admin/rsvg-convert.c b/admin/rsvg-convert.c index 7ed5a9910..655a25720 100644 --- a/admin/rsvg-convert.c +++ b/admin/rsvg-convert.c @@ -35,6 +35,7 @@ #include #include #include +#include #include #include @@ -71,7 +72,7 @@ static void display_error (GError * err) { if (err) { - g_print ("%s", err->message); + g_print ("%s\n", err->message); g_error_free (err); } } @@ -87,8 +88,9 @@ rsvg_cairo_size_callback (int *width, int *height, gpointer data) static cairo_status_t rsvg_cairo_write_func (void *closure, const unsigned char *data, unsigned int length) { - fwrite (data, 1, length, (FILE *) closure); - return CAIRO_STATUS_SUCCESS; + if (fwrite (data, 1, length, (FILE *) closure) == length) + return CAIRO_STATUS_SUCCESS; + return CAIRO_STATUS_WRITE_ERROR; } int @@ -124,6 +126,9 @@ main (int argc, char **argv) {NULL} }; + /* Set the locale so that UTF-8 filenames work */ + setlocale(LC_ALL, ""); + g_thread_init(NULL); g_option_context = g_option_context_new (_("- SVG Converter"));