Results 1 to 2 of 2

Thread: Preserving filenames in QProcess

  1. #1
    Join Date
    Mar 2007
    Posts
    58
    Thanked 2 Times in 2 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Preserving filenames in QProcess

    I'm having a problem in Windows.

    If I try to pass to another process (using QProcess) a filename containing Japanese, Chinese (or other alphabet) characters, these characters are lost (they are replaced by "?"), so the external process can't open the file.

    I think QProcess is converting the filename to the system locale, but it must be doing wrong.

    Is there any way to preserve those characters?

  2. #2
    Join Date
    May 2006
    Posts
    788
    Thanks
    49
    Thanked 48 Times in 46 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Preserving filenames in QProcess

    Quote Originally Posted by Pepe View Post
    I'm having a problem in Windows.

    If I try to pass to another process (using QProcess) a filename containing Japanese, Chinese (or other alphabet) characters, these characters are lost (they are replaced by "?"), so the external process can't open the file.

    I think QProcess is converting the filename to the system locale, but it must be doing wrong.

    Is there any way to preserve those characters?

    like e-mail encodeBase64 .




    Qt Code:
    1. /* encode to name */
    2. QString encodeBase64( QString xml )
    3. {
    4. QByteArray text;
    5. text.append(xml);
    6. return text.toBase64();
    7. }
    8.  
    9. /* decode to name */
    10. QString decodeBase64( QString xml )
    11. {
    12. QByteArray xcode("");;
    13. xcode.append(xml);
    14. QByteArray precode(QByteArray::fromBase64(xcode));
    15. QString notetxt = precode.data();
    16. return notetxt;
    17. }
    To copy to clipboard, switch view to plain text mode 

Similar Threads

  1. QProcess and Pipes
    By KaptainKarl in forum Qt Programming
    Replies: 1
    Last Post: 9th April 2007, 23:11
  2. QProcess / system call not working under linux. Why?
    By johnny_sparx in forum Qt Programming
    Replies: 12
    Last Post: 11th March 2006, 00:32

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.