Results 1 to 1 of 1

Thread: 8-bit params for QProcess

  1. #1
    Join Date
    Aug 2015
    Qt products

    Default Re: 8-bit params for QProcess

    I have an app that must be launched with ASCII params. It treats them as an array of bytes so it must be ASCII and not UTF-8 etc. The values may be non-latin (so it's not a real ASCII, but any of codepages like CP-1251).
    In bash I can launch it as
    Qt Code:
    1. myapp --myparam $'abc...Z\xC0\xC1...\xFF'
    To copy to clipboard, switch view to plain text mode 
    I can't find a way to do this with QProcess...
    It seems to not use bash and launch processes directly, so I can't use $'\xnn' syntax.
    It also doesn't accept params in form other than QString. And there is no way to ask it to do QString::toLocal8Bit() before passing params to the app (so I could use QTextCodec::setCodecForLocale() to spoof UTF-8 with other codepage).

    Any ideas?

    Added after 1 49 minutes:

    I've realized that QProcess apply QFile::encodeName() to each arg so the problem may be bypassed with QTextCodec::setCodecForLocale(). Case closed.
    Last edited by truf; 28th August 2015 at 13:18.

Similar Threads

  1. Replies: 0
    Last Post: 17th April 2014, 21:34
  2. Get the params of
    By brcontainer in forum Qt Programming
    Replies: 4
    Last Post: 21st February 2014, 05:13
  3. Replies: 1
    Last Post: 3rd June 2013, 14:11
  4. slots with params problem
    By brantyou in forum Newbie
    Replies: 1
    Last Post: 15th September 2010, 06:36
  5. Qt as only Gui Module (QMainWindow Params)
    By radex99 in forum Qt Programming
    Replies: 4
    Last Post: 30th August 2010, 19:13

Tags for this Thread


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.