diff --git a/src/common/kiwix/manager.cpp b/src/common/kiwix/manager.cpp index 34f53d0c3..dc681396c 100644 --- a/src/common/kiwix/manager.cpp +++ b/src/common/kiwix/manager.cpp @@ -95,12 +95,16 @@ namespace kiwix { } bool Manager::readFile(const string path, const bool readOnly) { + return this->readFile(path, path, readOnly); + } + + bool Manager::readFile(const string nativePath, const string UTF8Path, const bool readOnly) { bool retVal = true; pugi::xml_document doc; - pugi::xml_parse_result result = doc.load_file(path.c_str()); + pugi::xml_parse_result result = doc.load_file(nativePath.c_str()); if (result) { - this->parseXmlDom(doc, readOnly, path); + this->parseXmlDom(doc, readOnly, UTF8Path); } else { retVal = false; } @@ -109,7 +113,7 @@ namespace kiwix { * able to know where to save the library if new content are * available */ if (!readOnly) { - this->writableLibraryPath = path; + this->writableLibraryPath = UTF8Path; } return retVal; diff --git a/src/common/kiwix/manager.h b/src/common/kiwix/manager.h index 0891f5782..e05f9823d 100644 --- a/src/common/kiwix/manager.h +++ b/src/common/kiwix/manager.h @@ -46,6 +46,7 @@ namespace kiwix { ~Manager(); bool readFile(const string path, const bool readOnly = true); + bool readFile(const string nativePath, const string UTF8Path, const bool readOnly = true); bool readXml(const string xml, const bool readOnly = true, const string libraryPath = ""); bool writeFile(const string path); bool removeBookByIndex(const unsigned int bookIndex);