- if ( ! g_file_get_contents (filename, &text, NULL, &err) )
+ if ( ! g_file_get_contents (filename, &text_locale, &len_locale, &err) )
+ {
+ error_dialog (GTK_WINDOW (window), filename, err);
+ g_clear_error (&err);
+ return FALSE;
+ }
+
+ text_utf8 = g_locale_to_utf8 (text_locale, len_locale, NULL, &len_utf8, &err);
+
+ free (text_locale);
+
+ if ( text_utf8 == NULL )