Exception thrown when invalid path convertion
Describe the bug
The function convert_path
in gexiv2-metadata.cpp
throw an exception (which is not catched) when it cannot convert a path to the local encoding.
Indeed the function return FALSE (line 479) in case of error instead of an empty string.
To Reproduce
Steps to reproduce the behavior:
- Call
gexiv2_metadata_open_path
with a path which contain UTF-8 characters that cannot be represented in the current locale.
Expected behaviour
The function should only return an error.
Desktop
- OS: Windows
- Compiler & version: gcc on msys2-ucrt64
Additional context
The error occurred because exiv2 remove the wstring support in version 0.28.0 (seed this exiv2 issue).
Instead we should set the locale to UTF-8 on windows.
Edited by Rémi BERTHO