Results 1 to 8 of 8

Thread: QHttpResponseHeader encode & Save COOKIE value %20

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #7
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,376
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Thanks
    4
    Thanked 5,019 Times in 4,795 Posts
    Wiki edits
    10

    Default Re: QHttpResponseHeader encode & Save COOKIE value %20

    I'd prefer something like that (not tested):

    Qt Code:
    1. QString stringToDecode;
    2. QRegExp rx("%(\\d\\d)");
    3. int pos = 0;
    4. while((pos=rx.indexIn(stringToDecode, pos))!=-1){
    5. uint val = rx.cap(1).toUInt(0, 16);
    6. stringToDecode.replace(pos, 3, QString(QChar(val)));
    7. }
    To copy to clipboard, switch view to plain text mode 

    After this "stringToDecode" should contain the converted string.

  2. The following user says thank you to wysota for this useful post:

    patrik08 (2nd November 2006)

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.