MailCore / mailcore2

MailCore 2 provide a simple and asynchronous API to work with e-mail protocols IMAP, POP and SMTP. The API has been redesigned from ground up.
Other
2.58k stars 623 forks source link

The content of the email contains Chinese and is garbled #1972

Closed gnmmdk closed 1 year ago

gnmmdk commented 1 year ago

I use fetchParsedMessageByUIDOperation to get the value of Messageparser, messageParser. htmlRendering() or garbled code。As follows: val messageParserOperation = session.fetchParsedMessageByUIDOperation(mailFolder.folder,uid) messageParserOperation.start(object :OperationCallback{ override fun succeeded() { val messageParser = messageParserOperation.parser() val html = messageParser.htmlRendering() MailCoreLog.e("messageParser html>>>$html") }

                override fun failed(p0: MailException?) {
                }

            })

The results are as follows: image

gnmmdk commented 1 year ago

Currently, my project uses

Mailcore2-android-4.aar This is the aar package compiled in 2016. Is this package too old, so there will be the problem of garbled mail content?


mailcore2-android-4.aar http://d.etpan.org/mailcore2-deps/mailcore2-android/

If I compile the Android AAR package myself, I use https://github.com/dinhvh/libetpan Compile? It seems that this library was modified three years ago! The build-android library under mailcore 2 has not been updated for 7 years https://github.com/MailCore/mailcore2/tree/master/build-android

gnmmdk commented 1 year ago

I use fetchParsedMessageByUIDOperation to get the value of Messageparser, messageParser. htmlRendering() or garbled code。As follows: val messageParserOperation = session.fetchParsedMessageByUIDOperation(mailFolder.folder,uid) messageParserOperation.start(object :OperationCallback{ override fun succeeded() { val messageParser = messageParserOperation.parser() val html = messageParser.htmlRendering() MailCoreLog.e("messageParser html>>>$html") }

                override fun failed(p0: MailException?) {
                }

            })

The results are as follows: image

I use qq mailbox

gnmmdk commented 1 year ago

The following link solves the problem. However, the aar package compiled by the elder brother himself has modified the source code.

https://github.com/kongpf8848/MailCore2Example