In Windows Explorer, files with special characters in filepath don't open when double-clicked

• Apr 19, 2019 - 12:57
Reported version
3.0
Type
Functional
Frequency
Many
Severity
S3 - Major
Reproducibility
Always
Status
active
Regression
Yes
Workaround
Yes
Project

1) On Windows, open the native File Explorer (Windows Explorer)
2) Create a directory, named with at least one special character. E.g.: "♫ Demo"
3) In this new dir, create/save/put inside, a .mscz file
4) Open this file from the Windows Explorer (double-click, or select the file and press [Enter])
5) In Musescore you get an error message and the file don't open:
Can not read file E: \? Demo \ Test.mscz:
The file name, repertory or volume syntax is incorrect.

Note 1: the same issue happen if the filename have special/exotic chars.
Note 2: saving a file named with special chars, or inside a dir that have special chars doesn't cause any issues.
Note 3: this issue isn't reproducable with other type files, like .txt files, and with other apps like notepad, notepad++, etc. And .mscz files can still be opened by any text editor without issues.

Workaround: drag and drop the file on the MuseScore window to open correctly the file (without any issue).

Attachment Size
Test.zip 3.66 KB
screencast.gif 295.25 KB

Comments

This problem is actually quite common and I have come across it in many different applications. Some managed to do some change in programming to support this with the use of Unicode support. An example is IrfanView.

Maybe someone could ask the author of IrfanView what changes he had made to the source code in order to support non-ANSI string in filename path.

This seems a plain MuseScore 3 issue, MuseScore 2 (I checked with 2.3.2) has no such problem. So it doesn't seem to be a plain Windows issue either.
Another working example is 7Zip.

Regression No Yes

Might be an issue with Qt (5.4 for MuseScore 2, 5.9/5.12 for MuseScore 3) on Windows?
Or something about the installer, registering file types differently?

Hah! It is an MSVC issue, a MinGW build works!

Is that related to the compiler switches /execution-charset:utf-8 /source-charset:utf-8 (which could get shortened to just /utf-8 BTW)?
I found https://stackoverflow.com/questions/30829364/open-utf8-encoded-filename… which claims: On Windows, you MUST use 8bit ANSI (and it must match the user's locale) or UTF16 for filenames, there is no other option available

What actually is the difference between opening a score via File > Open and when passed as an argument into main()?
Maybe we just need to convert the commandline filenames into the same format that File > Open uses?

Title From the Windows Explorer: Double-click on files with special characters in filepath don't open (Windows) In Windows Explorer, files with special characters in filepath don't open when double-clicked