mirror of
https://github.com/goatcorp/Dalamud.git
synced 2026-02-25 14:11:48 +01:00
Do not use std::wofstream
This commit is contained in:
parent
2deeacd443
commit
8f31f7e75f
1 changed files with 8 additions and 1 deletions
|
|
@ -1078,7 +1078,14 @@ int main() {
|
||||||
window_log_str = log.str();
|
window_log_str = log.str();
|
||||||
|
|
||||||
print_exception_info_extended(exinfo.ExceptionPointers, exinfo.ContextRecord, log);
|
print_exception_info_extended(exinfo.ExceptionPointers, exinfo.ContextRecord, log);
|
||||||
std::wofstream(logPath) << log.str();
|
if (const auto temp = ws_to_u8(log.str()); !temp.empty()) {
|
||||||
|
std::ofstream(logPath, std::ios::binary).write(temp.data(), temp.size());
|
||||||
|
} else {
|
||||||
|
// for some reason couldn't be converted to UTF-8; write in UTF-16
|
||||||
|
const auto temp2 = log.str();
|
||||||
|
const auto temp3 = std::span(reinterpret_cast<const char*>(temp2.data()), temp2.size() * sizeof(temp2[0]));
|
||||||
|
std::ofstream(logPath, std::ios::binary).write(temp3.data(), temp3.size());
|
||||||
|
}
|
||||||
|
|
||||||
TASKDIALOGCONFIG config = { 0 };
|
TASKDIALOGCONFIG config = { 0 };
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue