--- src/drv_imap.c | 7 +++++++ src/main.c | 2 ++ 2 files changed, 9 insertions(+)
diff --git a/src/drv_imap.c b/src/drv_imap.c index 918dead..f50e0a5 100644 --- a/src/drv_imap.c +++ b/src/drv_imap.c @@ -1371,6 +1371,7 @@ parse_list_rsp_p2( imap_store_t *ctx, list_t *list, char *cmd ATTR_UNUSED ) { string_list_t *narg; char *arg; + char *arg_locale = NULL; int argl, l; if (!is_atom( list )) { @@ -1393,6 +1394,11 @@ parse_list_rsp_p2( imap_store_t *ctx, list_t *list, char *cmd ATTR_UNUSED ) goto skip; } } + arg_locale = decode_utf7_imap(arg); + if (arg_locale != NULL) { + arg = arg_locale; + argl = strlen(arg_locale); + } if (argl >= 5 && !memcmp( arg + argl - 5, ".lock", 5 )) /* workaround broken servers */ goto skip; if (map_name( arg, (char **)&narg, offsetof(string_list_t, string), ctx->delimiter, "/") < 0) { @@ -1402,6 +1408,7 @@ parse_list_rsp_p2( imap_store_t *ctx, list_t *list, char *cmd ATTR_UNUSED ) narg->next = ctx->boxes; ctx->boxes = narg; skip: + free(arg_locale); free_list( list ); return LIST_OK; } diff --git a/src/main.c b/src/main.c index eadd81f..682731d 100644 --- a/src/main.c +++ b/src/main.c @@ -22,6 +22,7 @@ #include "sync.h" +#include <locale.h> #include <stdlib.h> #include <stddef.h> #include <unistd.h> @@ -411,6 +412,7 @@ main( int argc, char **argv ) int oind, cops = 0, op, ops[2] = { 0, 0 }, pseudo = 0; tzset(); + setlocale(LC_ALL, ""); gethostname( Hostname, sizeof(Hostname) ); if ((ochar = strchr( Hostname, '.' ))) *ochar = 0; -- 2.26.2 _______________________________________________ isync-devel mailing list isync-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/isync-devel