aboutsummaryrefslogtreecommitdiff
path: root/src/main.c
diff options
context:
space:
mode:
authorhiro <hiro@ee746299-78ed-0310-b773-934348b2243d>2006-01-20 10:44:24 +0000
committerhiro <hiro@ee746299-78ed-0310-b773-934348b2243d>2006-01-20 10:44:24 +0000
commit3206d072bf2428930bea2d4c7a66bd68db1a467c (patch)
treee3904abdc6672f503bb07d66c4a39259b7ca28da /src/main.c
parent01d70967aec02a07321c0724bf62d9dd37daa6e0 (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/main.c')
-rw-r--r--src/main.c35
1 files changed, 31 insertions, 4 deletions
diff --git a/src/main.c b/src/main.c
index e815c91f..f06aab38 100644
--- a/src/main.c
+++ b/src/main.c
@@ -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)