1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-06-21 00:19:29 +02:00

Fix loading of non-ASCII text files

This commit is contained in:
Ivan Savenko
2023-03-05 21:50:38 +02:00
parent 7ef5163d9d
commit df50a17d2a
2 changed files with 7 additions and 7 deletions

View File

@ -99,13 +99,14 @@ protected:
}
};
CLegacyConfigParser::CLegacyConfigParser(std::string URI):
CLegacyConfigParser(CResourceHandler::get()->load(ResourceID(URI, EResType::TEXT)))
CLegacyConfigParser::CLegacyConfigParser(std::string URI)
{
}
ResourceID resource(URI, EResType::TEXT);
auto input = CResourceHandler::get()->load(resource);
std::string modName = VLC->modh->findResourceOrigin(resource);
std::string language = VLC->modh->getModLanguage(modName);
fileEncoding = Languages::getLanguageOptions(language).encoding;
CLegacyConfigParser::CLegacyConfigParser(const std::unique_ptr<CInputStream> & input)
{
data.reset(new char[input->getSize()]);
input->read(reinterpret_cast<uint8_t*>(data.get()), input->getSize());