mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2026-07-01 07:34:12 +02:00
31edf30c61
pugi::xml_document::load_file(const char*) calls fopen/fopen_s on Windows, which uses the ANSI codepage — not UTF-8. This silently fails when the collection path contains accented characters (é, ü, ñ, …) or is longer than the narrow-API MAX_PATH limit, leaving the collection panel with no element names or illustrations. Switch both call sites to toStdWString().c_str() which invokes the load_file(const wchar_t*) overload. On Windows pugixml calls _wfopen, the wide Unicode API that handles all valid Unicode paths. On Linux/macOS the same overload converts wchar_t to UTF-8 internally and calls fopen, so behaviour is unchanged on those platforms. Affected files: sources/ElementsCollection/fileelementcollectionitem.cpp (qet_directory load) sources/ElementsCollection/elementslocation.cpp (element .elmt load, both branches) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>