Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-84002

Qt detects Unicode command line arguments as question marks

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Out of scope
    • Icon: P3: Somewhat important P3: Somewhat important
    • None
    • 5.7.0, 5.14.0
    • Core: Other
    • None
    • Microsoft Windows 10
    • Windows

      Sometimes when I build a Qt C++ app (MinGW) and open it with arguments in Windows 10, it shows Unicode arguments as question marks. I don't really know when but I think it depends on parameter's length and being or not being whitespaces in parameter.

       

      For example (demonstration):

      ( chcp 65001 )
       

      >app.exe سلام

      receives: سلام

       

      >app.exe سلاممممم

      receives: سلاممممم

       

      >app.exe سلامممممم

      receives: ?????????

       

      >app.exe d:\خطا

      receives: d:???

       

      >app.exe "d:\خطا دار"

      receives: d:\خطا دار

       

      >app.exe C:\Users\Reza\Desktop\خطا.txt

      receives: C:\Users\Reza\Desktop???.txt

       

      >app.exe C:\Users\Default\Desktop\خطا.txt

      receives: C:\Users\Default\Desktop\خطا.txt

       

       

      I tested using QCommandLineParser, and also app.arguments() but all were the same.

       

      Even I checked values stored in argv[] manually and even there, some Unicode characters where stored as question marks.

        1. main.cpp
          0.9 kB
        2. qtbug84002.jpg
          qtbug84002.jpg
          115 kB
        3. qtbug84002.zip
          2 kB
        4. u3.pro
          0.4 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            thiago Thiago Macieira
            reza55n Reza Alizadeh
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes