r23700 - gnucash/trunk/src/backend/xml - Bug 721576 - Gnucash can not work with files, that have russian symbols in path.

John Ralls jralls at code.gnucash.org
Thu Jan 16 19:03:47 EST 2014


Author: jralls
Date: 2014-01-16 19:03:47 -0500 (Thu, 16 Jan 2014)
New Revision: 23700
Trac: http://svn.gnucash.org/trac/changeset/23700

Modified:
   gnucash/trunk/src/backend/xml/io-gncxml-v2.c
Log:
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.

Modified: gnucash/trunk/src/backend/xml/io-gncxml-v2.c
===================================================================
--- gnucash/trunk/src/backend/xml/io-gncxml-v2.c	2014-01-16 22:52:03 UTC (rev 23699)
+++ gnucash/trunk/src/backend/xml/io-gncxml-v2.c	2014-01-17 00:03:47 UTC (rev 23700)
@@ -786,38 +786,29 @@
     }
     else
     {
-        /* Even though libxml2 knows how to decompress zipped files, we do it 
-           ourself since as of version 2.9.1 it has a bug that causes it to fail
-           to decompress certain files.  
-           See https://bugzilla.gnome.org/show_bug.cgi?id=712528 for more info */
-        gchar *filename = fbe->fullpath;
-#ifdef G_OS_WIN32
-        filename = g_win32_locale_filename_from_utf8(fbe->fullpath);
-        if (filename)
-        {
-#endif
-            FILE *file;
-            gboolean is_compressed = is_gzipped_file(filename);
-            file = try_gz_open(filename, "r", is_compressed, FALSE);
-            if (file == NULL)
-            {
-                PWARN("Unable to open file %s", filename);
-                retval = FALSE;
-            }
-            else
-            {
-                retval = gnc_xml_parse_fd(top_parser, file,
-                                          generic_callback, gd, book);
-                fclose(file);
-                if (is_compressed)
-                    wait_for_gzip(file);
-            }
-#ifdef G_OS_WIN32
-            g_free(filename);
-        }
-        else
-            retval = FALSE;
-#endif
+	/* Even though libxml2 knows how to decompress zipped files, we
+	 * do it ourself since as of version 2.9.1 it has a bug that
+	 * causes it to fail to decompress certain files. See
+	 * https://bugzilla.gnome.org/show_bug.cgi?id=712528 for more
+	 * info.
+	 */
+	gchar *filename = fbe->fullpath;
+	FILE *file;
+	gboolean is_compressed = is_gzipped_file(filename);
+	file = try_gz_open(filename, "r", is_compressed, FALSE);
+	if (file == NULL)
+	{
+	    PWARN("Unable to open file %s", filename);
+	    retval = FALSE;
+	}
+	else
+	{
+	    retval = gnc_xml_parse_fd(top_parser, file,
+				      generic_callback, gd, book);
+	    fclose(file);
+	    if (is_compressed)
+		wait_for_gzip(file);
+	}
     }
 
     if (!retval)



More information about the gnucash-changes mailing list