diff options
author | hiro <hiro@ee746299-78ed-0310-b773-934348b2243d> | 2006-01-20 10:44:24 +0000 |
---|---|---|
committer | hiro <hiro@ee746299-78ed-0310-b773-934348b2243d> | 2006-01-20 10:44:24 +0000 |
commit | 3206d072bf2428930bea2d4c7a66bd68db1a467c (patch) | |
tree | e3904abdc6672f503bb07d66c4a39259b7ca28da /src | |
parent | 01d70967aec02a07321c0724bf62d9dd37daa6e0 (diff) |
allow non-ascii mailto string and filename on --compose option.
git-svn-id: svn://sylpheed.sraoss.jp/sylpheed/trunk@916 ee746299-78ed-0310-b773-934348b2243d
Diffstat (limited to 'src')
-rw-r--r-- | src/compose.c | 8 | ||||
-rw-r--r-- | src/main.c | 35 |
2 files changed, 37 insertions, 6 deletions
diff --git a/src/compose.c b/src/compose.c index 3a216f47..071cbd7b 100644 --- a/src/compose.c +++ b/src/compose.c @@ -1,6 +1,6 @@ /* * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client - * Copyright (C) 1999-2005 Hiroyuki Yamamoto + * Copyright (C) 1999-2006 Hiroyuki Yamamoto * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -721,8 +721,12 @@ void compose_new(PrefsAccount *account, FolderItem *item, const gchar *mailto, gchar *file; for (i = 0; i < attach_files->len; i++) { + gchar *utf8file; + file = g_ptr_array_index(attach_files, i); - compose_attach_append(compose, file, file, NULL); + utf8file = conv_filename_to_utf8(file); + compose_attach_append(compose, file, utf8file, NULL); + g_free(utf8file); } } @@ -1127,14 +1127,41 @@ static void migrate_old_config(void) static void open_compose_new(const gchar *address, GPtrArray *attach_files) { - gchar *addr = NULL; + gchar *utf8addr = NULL; +#ifdef G_OS_WIN32 + GPtrArray *utf8files = NULL; +#endif if (address) { - Xstrdup_a(addr, address, return); - g_strstrip(addr); + utf8addr = g_locale_to_utf8(address, -1, NULL, NULL, NULL); + if (utf8addr) + g_strstrip(utf8addr); } - compose_new(NULL, NULL, addr, attach_files); +#ifdef G_OS_WIN32 + if (attach_files) { + gint i; + gchar *utf8file; + + utf8files = g_ptr_array_new(); + for (i = 0; i < attach_files->len; i++) { + file = g_ptr_array_index(attach_files, i); + utf8file = g_locale_to_utf8(file, -1, NULL, NULL, NULL); + if (utf8file) + g_ptr_array_add(utf8files, utf8file); + } + } + + compose_new(NULL, NULL, utf8addr, utf8files); + if (utf8files) { + ptr_array_free_strings(utf8files); + g_ptr_array_free(utf8files); + } +#else + compose_new(NULL, NULL, utf8addr, attach_files); +#endif + + g_free(utf8addr); } static void send_queue(void) |