diff options
| author | 2018-12-07 16:21:18 +0100 | |
|---|---|---|
| committer | 2018-12-07 16:21:18 +0100 | |
| commit | eb15711ee68f15a48747820bd0639a711c767557 (patch) | |
| tree | 0656440a64333fdd78871a286f0891797ab89ecc /src/common/logging/backend.cpp | |
| parent | Merge pull request #1868 from lioncash/config (diff) | |
| download | yuzu-eb15711ee68f15a48747820bd0639a711c767557.tar.gz yuzu-eb15711ee68f15a48747820bd0639a711c767557.tar.xz yuzu-eb15711ee68f15a48747820bd0639a711c767557.zip | |
Backport review comment from citra-emu/citra#4418
Original reason:
As Windows multi-byte character codec is unspecified while we always assume std::string uses UTF-8 in our code base, this can output gibberish when the string contains non-ASCII characters. ::OutputDebugStringW combined with Common::UTF8ToUTF16W is preferred here.
Diffstat (limited to 'src/common/logging/backend.cpp')
| -rw-r--r-- | src/common/logging/backend.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/common/logging/backend.cpp b/src/common/logging/backend.cpp index 5753b871a..12f6d0114 100644 --- a/src/common/logging/backend.cpp +++ b/src/common/logging/backend.cpp | |||
| @@ -13,7 +13,7 @@ | |||
| 13 | #include <vector> | 13 | #include <vector> |
| 14 | #ifdef _WIN32 | 14 | #ifdef _WIN32 |
| 15 | #include <share.h> // For _SH_DENYWR | 15 | #include <share.h> // For _SH_DENYWR |
| 16 | #include <windows.h> // For OutputDebugStringA | 16 | #include <windows.h> // For OutputDebugStringW |
| 17 | #else | 17 | #else |
| 18 | #define _SH_DENYWR 0 | 18 | #define _SH_DENYWR 0 |
| 19 | #endif | 19 | #endif |
| @@ -148,7 +148,7 @@ void FileBackend::Write(const Entry& entry) { | |||
| 148 | 148 | ||
| 149 | void DebuggerBackend::Write(const Entry& entry) { | 149 | void DebuggerBackend::Write(const Entry& entry) { |
| 150 | #ifdef _WIN32 | 150 | #ifdef _WIN32 |
| 151 | ::OutputDebugStringA(FormatLogMessage(entry).append(1, '\n').c_str()); | 151 | ::OutputDebugStringW(Common::UTF8ToUTF16W(FormatLogMessage(entry).append(1, '\n')).c_str()); |
| 152 | #endif | 152 | #endif |
| 153 | } | 153 | } |
| 154 | 154 | ||