Results 1 to 4 of 4

Thread: Problem with different charsets when reading attachments' names during pop3 session.

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Feb 2010
    Posts
    68
    Thanks
    8
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Problem with different charsets when reading attachments' names during pop3 session.

    Hello,

    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:
    "=?iso-8859-2?Q?Lily_Allen_-_It=27s_Not_Me=2C_It=27s_You_[2009].rar?="
    Another example - the original name of an attachment:
    3D_Mario_Forefer.rar
    An in Qt it is:
    "=?UTF-8?Q?3D=5FMario=5FForefer.rar?="

    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,
    Michael.

  2. #2
    Join Date
    Sep 2009
    Location
    UK
    Posts
    2,447
    Thanks
    6
    Thanked 348 Times in 333 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Problem with different charsets when reading attachments' names during pop3 sessi

    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 ,
    etc.

    All that is happening is 7-bit encoding.

  3. #3
    Join Date
    Feb 2010
    Posts
    68
    Thanks
    8
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Problem with different charsets when reading attachments' names during pop3 sessi

    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.

  4. #4
    Join Date
    Feb 2010
    Posts
    68
    Thanks
    8
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Problem with different charsets when reading attachments' names during pop3 sessi

    I'd like to refresh the question above.

Similar Threads

  1. Replies: 2
    Last Post: 4th July 2010, 22:49
  2. Downloading specific mails using POP3 protocol.
    By kremuwa in forum General Programming
    Replies: 1
    Last Post: 22nd May 2010, 10:06
  3. Simply Client E-mail (POP3)
    By Altertwin in forum Qt Programming
    Replies: 5
    Last Post: 25th February 2010, 17:27
  4. QWidget Attachments
    By BingoMaster in forum Newbie
    Replies: 4
    Last Post: 27th September 2009, 21:07
  5. Reading a unicode names from a file???
    By darpan in forum Qt Programming
    Replies: 7
    Last Post: 3rd May 2006, 17:28

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.