karastojko / mailio

mailio is a cross platform C++ library for MIME format and SMTP, POP3 and IMAP protocols. It is based on standard C++ 17 and Boost library.
Other
372 stars 98 forks source link

IMAP list folder, encoding error ? #132

Open YZJClear opened 1 year ago

YZJClear commented 1 year ago

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-
tsurumi-yizhou commented 1 year ago

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

karastojko commented 1 year ago

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

YZJClear commented 1 year ago

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

karastojko commented 1 year ago

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

YZJClear commented 1 year ago

Looking forward to your updates

YZJClear commented 1 year ago

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

tsurumi-yizhou commented 1 year ago

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

YZJClear commented 1 year ago

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

你知道怎么解决吗

karastojko commented 1 year ago

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

YZJClear commented 10 months ago

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)

karastojko commented 10 months ago

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.

YZJClear commented 8 months ago

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