View Full Version : Problem with different charsets when reading attachments' names during pop3 session.

8th July 2010, 08:03

When I'm analysing content of a mailbox, I send TOP commands to gather some information. For example, on the mailbox, I've got a mail with one attachment called:
"Lily Allen - It's Not Me, It's You [2009].rar"
But when I'm receiving the content of this mail using Qt and POP3 protocol, the filename is:
Another example - the original name of an attachment:
An in Qt it is:

How to deal with these different charsets? Is there a way to obtain the original filenames from these weird ones?

Thank you in advance for your effort,

8th July 2010, 08:15
Sure, parse the filename in the char set specified. For example, =27 is the hex code for ascii 39 '
=2C is the hex code for ascii 44 ,

All that is happening is 7-bit encoding.

8th July 2010, 13:34
Is there any convenient function in Qt ready to do just that? I was looking at .fromUtf8, .fromAscii and so on, but I don't really get how they work.

9th July 2010, 20:55
I'd like to refresh the question above.