[Windows] load image with filenames other than english
The idea behind this PR is to use std::filesystem::path object to store the filename until right up the freeimage function is called. FreeImage has some special functions to handle wstring, so they are called for windows, conserving original encoding.
Hey @oxillo please check this PR when you have the time. I don't know much about windows but I've tried to fix path encodings there, it seems to be working.
PS: there is a test there meant to be removed before merge
@dimitre the UTF16 encoding of filenames in Windows is generally hard to handle. I'm not an expert on that. I've tested on MINGW64 and UCRT64. The system dialogs works fine in both environments. So I think the filepaths are correctly handled. The only problem is on console output that doesn't work in MINGW64 but it was expected.
Nice. it worked here in a file called consolação.jpg on which didnt load before. I've put this file temporarly on this pr on examples/dimitre/Test folder. It is latin so I'm not sure about other languages @artificiel any opinion on this one?
think this one should wait for after 0.12.0 as I see some possible issues here with the changes required.
I've finally got a windows machine and some time to advance on this PR and test.
I think it is good to merge.
It addresses encoding issues loading files, and with the title in open file dialog box.
I think the only controversial change here is the return type change in of::filesystem::path ofFileDialogResult::getName() and ofFileDialogResult::getPath()
opinions are welcome @ofTheo @oxillo @artificiel @openframeworks/windows
Hello @ofTheo I think this one is good to go. Resolves a dread windows problem where you cannot load files in ofSystemLoadDialog with any accentuation and pass correctly to load an ofImage.
There is a test here: https://github.com/dimitre/ofTests/tree/main/WinEncoding
https://github.com/openframeworks/openFrameworks/pull/7435#issuecomment-1515304092
@danoli3 can you double check this one if you have the time? btw, thanks for the other windows PR merging, OF is almost ready to work with multiple languages