Correctly open the library path on windows.

We need to convert the path to wstring on Windows to handle directory
with accented characters.

Fix kiwix-desktop#269
This commit is contained in:
Matthieu Gautier 2020-01-13 16:54:09 +01:00
parent 7c7e351d34
commit 5540149e2b
1 changed files with 7 additions and 0 deletions

View File

@ -19,6 +19,8 @@
#include "manager.h"
#include "tools/pathTools.h"
#include <pugixml.hpp>
namespace kiwix
@ -145,7 +147,12 @@ bool Manager::readFile(const std::string& nativePath,
{
bool retVal = true;
pugi::xml_document doc;
#ifdef _WIN32
pugi::xml_parse_result result = doc.load_file(Utf8ToWide(nativePath).c_str());
#else
pugi::xml_parse_result result = doc.load_file(nativePath.c_str());
#endif
if (result) {
this->parseXmlDom(doc, readOnly, UTF8Path);