Results 1 to 2 of 2

Thread: Get unicode string with QSslSocket

  1. #1
    Join Date
    Jul 2013
    Posts
    9
    Thanks
    5

    Default Get unicode string with QSslSocket

    I am working with QSslSocket to get Gmail emails. I want to check all folders in server:

    Qt Code:
    1. QSslSocket::write("tag LIST \"\" \"*\"");
    To copy to clipboard, switch view to plain text mode 

    The output is:

    Qt Code:
    1. * LIST (\HasChildren) "/" "INBOX"
    2. * LIST (\HasNoChildren) "/" "INBOX/Test1"
    3. * LIST (\HasNoChildren) "/" "INBOX/Test2"
    4. * LIST (\Noselect \HasChildren) "/" "[Gmail]"
    5. * LIST (\HasNoChildren \All) "/" "[Gmail]/Alle Nachrichten"
    6. * LIST (\HasNoChildren \Drafts) "/" "[Gmail]/Entw&APw-rfe"
    7. * LIST (\HasNoChildren \Sent) "/" "[Gmail]/Gesendet"
    8. * LIST (\HasNoChildren \Flagged) "/" "[Gmail]/Markiert"
    9. * LIST (\HasChildren \Trash) "/" "[Gmail]/Papierkorb"
    To copy to clipboard, switch view to plain text mode 

    Then I want to select one of those folder, I select INBOX folder for example:

    Qt Code:
    1. QSslSocket::write("tag SELECT INBOX");
    To copy to clipboard, switch view to plain text mode 

    It works fine, but when I select folder "[Gmail]/Entw&APw-rfe", it does not work anymore. I think the problem is the encoding of text "Entw&APw-rfe" (in unicode is "Entwürfe"). So how can I get exactly the name of the folder in unicode and input it in command? Does Qt have a library to process this?
    Thanks for help!

  2. #2
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Get unicode string with QSslSocket

    Identify the encoding being used, check the list of supported text codecs http://qt-project.org/doc/qt-5.0/qtcore/qtextcodec.html

    Cheers,
    _

Similar Threads

  1. QSslSocket get SNI
    By Landkeeper in forum Qt Programming
    Replies: 0
    Last Post: 22nd June 2013, 14:04
  2. UNICODE UTF-8 String in QT + Eclipse?????
    By thaihoangluu in forum Newbie
    Replies: 7
    Last Post: 31st December 2011, 01:14
  3. QSslSocket example
    By Ratheendrans in forum Qt Programming
    Replies: 3
    Last Post: 6th July 2011, 20:51
  4. std:string how to change into system:string?
    By yunpeng880 in forum Qt Programming
    Replies: 1
    Last Post: 14th April 2009, 08:51
  5. NEED HELP!!! about qsslsocket
    By asnoka in forum Installation and Deployment
    Replies: 2
    Last Post: 12th May 2008, 15:12

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.