From e3a47d52b18d2e87511073a04836a6b86fcaa62b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20K=C3=B6hler?= Date: Fri, 23 Mar 2007 19:40:32 +0000 Subject: [PATCH] On Windows, convert filename parameter for xml parser to system codepage. git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@15749 57a11ea4-9604-0410-9ed3-97b8803252fd --- src/backend/file/sixtp.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/backend/file/sixtp.c b/src/backend/file/sixtp.c index 487e50c90a..80e3f1f403 100644 --- a/src/backend/file/sixtp.c +++ b/src/backend/file/sixtp.c @@ -727,7 +727,21 @@ sixtp_parse_file(sixtp *sixtp, gpointer *parse_result) { gboolean ret; - xmlParserCtxtPtr context = xmlCreateFileParserCtxt( filename ); + xmlParserCtxtPtr context; + +#ifdef G_OS_WIN32 + { + gchar *conv_name = g_win32_locale_filename_from_utf8(filename); + if (!conv_name) { + g_warning("Could not convert '%s' to system codepage", filename); + return FALSE; + } + context = xmlCreateFileParserCtxt(conv_name); + g_free(conv_name); + } +#else + context = xmlCreateFileParserCtxt(filename); +#endif ret = sixtp_parse_file_common(sixtp, context, data_for_top_level, global_data, parse_result); return ret;