Commit 35359f0b authored by nanahira's avatar nanahira

add wchar_t LoadStrings

parent 8d51b160
Pipeline #38070 passed with stages
in 6 minutes and 56 seconds
......@@ -121,6 +121,17 @@ bool DataManager::LoadStrings(const char* file) {
std::fclose(fp);
return true;
}
bool DataManager::LoadStrings(const wchar_t* file) {
FILE* fp = mywfopen(file, "r");
if(!fp)
return false;
char linebuf[TEXT_LINE_SIZE]{};
while(std::fgets(linebuf, sizeof linebuf, fp)) {
ReadStringConfLine(linebuf);
}
std::fclose(fp);
return true;
}
bool DataManager::LoadStrings(irr::io::IReadFile* reader) {
char ch{};
std::string linebuf;
......
......@@ -47,6 +47,7 @@ public:
bool LoadDB(const wchar_t* wfile);
bool LoadDB(irr::io::IReadFile* reader);
bool LoadStrings(const char* file);
bool LoadStrings(const wchar_t* file);
bool LoadStrings(irr::io::IReadFile* reader);
void ReadStringConfLine(const char* linebuf);
bool Error(sqlite3* pDB, sqlite3_stmt* pStmt = nullptr);
......
......@@ -1246,9 +1246,7 @@ void Game::LoadExpansions(const wchar_t* expansions_path) {
deckManager.LoadLFListSingle(fpath, true);
lflist_changed = true;
} else {
char upath[1024];
BufferIO::EncodeUTF8(fpath, upath);
dataManager.LoadStrings(upath);
dataManager.LoadStrings(fpath);
}
return;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment