Results 1 to 9 of 9

Thread: Ascii control characters

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Feb 2009
    Posts
    16
    Thanks
    2
    Platforms
    Unix/X11

    Default Re: Ascii control characters

    thanks for the input.

    That makes sense.

    but if that is the case, then if I add

    #define QT_NO_CAST_FROM_ASCII

    should add the complete line to the string?

    is that true?

    it gives the same result if I try it.

  2. #2
    Join Date
    Jan 2006
    Location
    Sta. Eugènia de Berga (Vic - Barcelona - Spain)
    Posts
    869
    Thanks
    70
    Thanked 59 Times in 57 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Ascii control characters

    Hi,

    I think that you have to add "48" to each char to obtain the desired character. Take a look at ASCII table where you can see that character "0" is 48 decimal. So this is basically a LUT.
    Try it and tell if it helps you.
    Òscar Llarch i Galán

  3. #3
    Join Date
    Feb 2009
    Posts
    16
    Thanks
    2
    Platforms
    Unix/X11

    Default Re: Ascii control characters

    thanks for all of your help

    here is how I fixed it:

    Qt Code:
    1. QString compressedString1 = QString::fromStdString(compressed_string1);
    2. QString compressedString1Q = compressedString1.toAscii().toHex();
    To copy to clipboard, switch view to plain text mode 

    this seemed to fix the issue.

Similar Threads

  1. How to Compare Characters ASCII value?
    By merry in forum Qt Programming
    Replies: 5
    Last Post: 14th July 2008, 12:05
  2. Replies: 4
    Last Post: 10th July 2007, 20:11
  3. Problem at time compilation in traslation of language
    By thomasjoy in forum Qt Programming
    Replies: 3
    Last Post: 22nd May 2007, 14:18
  4. Replies: 6
    Last Post: 3rd February 2006, 09:48

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.