mailio icon indicating copy to clipboard operation
mailio copied to clipboard

IMAP list folder, encoding error ?

Open YZJClear opened this issue 1 year ago • 12 comments

vcpkg: mailio[core]:x64-windows-static -> 0.21.0#2

code:

mailio::imap conn("xxx", 143);
conn.authenticate("admin", "xxx", mailio::imap::auth_method_t::LOGIN);
mailio::imap::mailbox_folder_t fld = conn.list_folders("");
print_folders(0, fld);

mail server: WinMail this result is cant reader, my inbox has chinese char result:

INBOX
        &V4NXPg-
        AZ
                AZ_&TgtTVQ-
                AZ_&U9GNJw-
                AZ_&UKxrPg-
                AZ_&XAFT9w-
                AZ_&Y9CNJw-
                AZ_&e35lNg-
                AZ_&e35lNngB-
                BS_&UWVekw-
                BS_&VAhedg-
                BS_&Y9CNJw-
                SF_&UWVekw-
                SF_&Y9CNJw-
                ZZ_&UWVekw-
        E-invoice
        ECS
                        &WSl,,E6R-
        EM
                                MAIL
                                VFEMAIL
        HKA
        HKA_&U9GNJw-


YZJClear avatar Jul 02 '23 16:07 YZJClear

This just deal with the transferring but not content of character coding. Problem of which should be your reader.

tsurumi-yizhou avatar Jul 02 '23 18:07 tsurumi-yizhou

So, your folders on the IMAP server have non-Latin characters and listing them throws an error?

karastojko avatar Jul 02 '23 19:07 karastojko

So, your folders on the IMAP server have non-Latin characters and listing them throws an error?

Yes, the server contains simplified Chinese and traditional Chinese, they can be displayed normally, javax.mail. It also works

YZJClear avatar Jul 05 '23 06:07 YZJClear

It is the feature I have never tested. Let me try it. Maybe I can easily add it as a new feature.

karastojko avatar Jul 05 '23 07:07 karastojko

Looking forward to your updates

YZJClear avatar Jul 05 '23 15:07 YZJClear

image It doesn't look like any coding, how should i handle that it should be Chinese characters

YZJClear avatar Jul 06 '23 09:07 YZJClear

The character coding should be automatically recognized by your reader from MIME.

tsurumi-yizhou avatar Jul 06 '23 15:07 tsurumi-yizhou

The character coding should be automatically recognized by your reader from MIME.

你知道怎么解决吗

YZJClear avatar Jul 26 '23 03:07 YZJClear

IMAP folders may be UTF7 encoded which is not currently supported by mailio. Thus, it is not a bug but the missing feature.

karastojko avatar Aug 12 '23 20:08 karastojko

IMAP folders may be UTF7 encoded which is not currently supported by mailio. Thus, it is not a bug but the missing feature.

Hello, I have two questions. First, do you have plans to add this feature? Second, are you Chinese? (I'm Chinease)

YZJClear avatar Nov 07 '23 05:11 YZJClear

I would have to check for a UTF-7 encoding C++ library, does it exist with MIT license or I should create such utility. Also, I need to see whether UTF-8 is also being used for this purposes. So, right now I do not have the straight-forward answer to your question. Regarding the nationality - I am not Chinese.

karastojko avatar Nov 15 '23 21:11 karastojko

Thank you, I will try the method you mentioned in the future.

YZJClear avatar Jan 13 '24 03:01 YZJClear