News:

--

Main Menu

get_folder_content bug in file name

Started by grmmx, December 11, 2019, 04:55:34 AM

Previous topic - Next topic

grmmx

Avidemux v2.7.5 Release

The get_folder_content function has a character encoding bug when working with file names.

For example:

The folder "Folder[äÜö]" contains a file "fileName[äÜö].avi"

inputFolder = "z:/Folder[äÜö]";
fileList = get_folder_content(inputFolder, "avi");

In fileList:
z:/Folder[äÜö]/fileName[���].avi

All non-ASCII characters in a file names are replaced with "?". A path name remains normal.

eumagga0x2a

With the latest VC++ nightly, I get umlauts in the folder name mangled while the filename is displayed correctly. VC++-only, MinGW builds are not affected.

All that with a .py file as input, the shell in Avidemux seems to be completely unable to pass non-ASCII characters to the script engine.

grmmx

Avidemux v2.7.5 Release, Windows 10

Source code "loadVideo.py":
#PY
ui = Gui();
adm = Avidemux();
inputFolder = "z:/Folder[äÜö]";
fileList = get_folder_content(inputFolder, "mp4");
if (fileList is None):
raise
for file in fileList:
ui.displayInfo("Info", "file: " + file);
if (0 == adm.loadVideo(file)):
raise


The folder "Folder[äÜö]" contains a file "fileName[äÜö].mp4"

displayInfo displays a message:
"file: z:/Folder[äÜö]/fileName[���].mp4"

After that, "adm.loadVideo" throws a TinyPy:Exception.

eumagga0x2a

We are very far past the 2.7.5 release in the development. The issue of character encoding mismatch has been confirmed, thank you for your report. It will be hopefully addressed in the future.

VC++ nightlies: https://avidemux.org/nightly/vsWin64/

MinGW nightlies: https://avidemux.org/nightly/win64/ (not affected by the bug)

eumagga0x2a

The author of Avidemux has fixed the issue, the latest VC++ nightly (191217 as of now) handles non-ASCII characters in get_folder_content() correctly according to my testing.