Bug 721576 - Gnucash can not work with files, that have russian symbols in path.

g_win32_locale_filename_from_utf8() is not only unnecessary, it does the
wrong thing.

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@23700 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
John Ralls 2014-01-17 00:03:47 +00:00
parent 767a25f7a7
commit 65e6185014

View File

@ -786,38 +786,29 @@ qof_session_load_from_xml_file_v2_full(
} }
else else
{ {
/* Even though libxml2 knows how to decompress zipped files, we do it /* Even though libxml2 knows how to decompress zipped files, we
ourself since as of version 2.9.1 it has a bug that causes it to fail * do it ourself since as of version 2.9.1 it has a bug that
to decompress certain files. * causes it to fail to decompress certain files. See
See https://bugzilla.gnome.org/show_bug.cgi?id=712528 for more info */ * https://bugzilla.gnome.org/show_bug.cgi?id=712528 for more
gchar *filename = fbe->fullpath; * info.
#ifdef G_OS_WIN32 */
filename = g_win32_locale_filename_from_utf8(fbe->fullpath); gchar *filename = fbe->fullpath;
if (filename) FILE *file;
{ gboolean is_compressed = is_gzipped_file(filename);
#endif file = try_gz_open(filename, "r", is_compressed, FALSE);
FILE *file; if (file == NULL)
gboolean is_compressed = is_gzipped_file(filename); {
file = try_gz_open(filename, "r", is_compressed, FALSE); PWARN("Unable to open file %s", filename);
if (file == NULL) retval = FALSE;
{ }
PWARN("Unable to open file %s", filename); else
retval = FALSE; {
} retval = gnc_xml_parse_fd(top_parser, file,
else generic_callback, gd, book);
{ fclose(file);
retval = gnc_xml_parse_fd(top_parser, file, if (is_compressed)
generic_callback, gd, book); wait_for_gzip(file);
fclose(file); }
if (is_compressed)
wait_for_gzip(file);
}
#ifdef G_OS_WIN32
g_free(filename);
}
else
retval = FALSE;
#endif
} }
if (!retval) if (!retval)