issue opening file with special chars in path (

  • estux

    estux - 2014-01-28


    I am using (7z.dll) in Window, MacOSX and Linux with Qt.

    My code for opening a file is:

    CInFileStream *fileSpec = new CInFileStream;
    if (!fileSpec->Open((LPCTSTR)filePath.toStdWString().data())) //filePath is a QString, I have used .data() and .c_str()
        //Error opening

    This is working fine in Window (32bit) and MacOSX(64bit). I have tested it in Linux (ubuntu 12.04, 13.10 64bit/32bit) and it fails opening any file when the path in "filePath" contains special chars, fe: "/home/myUser/Desktop/file-áéíóú.rar" ("/home/myUser/Desktop/file.rar" is working fine)

    I have compile by my self and I also have used the binaries in the p7zip Ubuntu's package.

    Any idea about what is going on here?

    Last edit: estux 2014-01-29
  • estux

    estux - 2014-01-29

    I have solved the issue, I was compiling with UNICODE flag enabled and it must be disabled.

    With UNICODE disabled the right code is:

    Last edit: estux 2014-01-29

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.

No, thanks