aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--addressbook/ChangeLog4
-rw-r--r--addressbook/importers/evolution-ldif-importer.c10
2 files changed, 12 insertions, 2 deletions
diff --git a/addressbook/ChangeLog b/addressbook/ChangeLog
index e8ee5b536d..98b5f7f70c 100644
--- a/addressbook/ChangeLog
+++ b/addressbook/ChangeLog
@@ -1,9 +1,13 @@
2005-11-25 Tor Lillqvist <tml@novell.com>
+ * importers/evolution-ldif-importer.c (ldif_import)
* gui/widgets/eab-gui-util.c (eab_load_error_dialog): Use
g_filename_from_uri() instead of just stripping off the "file://"
prefix for Win32 portability.
+ * importers/evolution-ldif-importer.c (ldif_import): Use gstdio
+ wrappers for better non-ASCII filename support on Windows.
+
* gui/component/addressbook-component.c (ensure_sources): Use
g_filename_to_uri() instead of just prefixing "file://" for Win32
portability.
diff --git a/addressbook/importers/evolution-ldif-importer.c b/addressbook/importers/evolution-ldif-importer.c
index e37d579726..dfec5dfc51 100644
--- a/addressbook/importers/evolution-ldif-importer.c
+++ b/addressbook/importers/evolution-ldif-importer.c
@@ -23,6 +23,7 @@
#include <string.h>
#include <glib/gi18n.h>
+#include <glib/gstdio.h>
#include <gtk/gtkvbox.h>
@@ -690,8 +691,9 @@ ldif_import(EImport *ei, EImportTarget *target, EImportImporter *im)
{
LDIFImporter *gci;
EBook *book;
- FILE *file;
+ FILE *file = NULL;
EImportTargetURI *s = (EImportTargetURI *)target;
+ gchar *filename;
book = e_book_new(g_datalist_get_data(&target->data, "ldif-source"), NULL);
if (book == NULL) {
@@ -700,7 +702,11 @@ ldif_import(EImport *ei, EImportTarget *target, EImportImporter *im)
return;
}
- file = fopen(s->uri_src+7, "r");
+ filename = g_filename_from_uri(s->uri_src, NULL, NULL);
+ if (filename != NULL) {
+ file = g_fopen(filename, "r");
+ g_free (filename);
+ }
if (file == NULL) {
g_message(G_STRLOC ":Can't open .ldif file");
e_import_complete(ei, target);