Skip to content

Commit

Permalink
Windows平台默认输出utf-8字符集
Browse files Browse the repository at this point in the history
  • Loading branch information
xia-chu committed Apr 20, 2024
1 parent 43004be commit 78d4c1d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Util/logger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,10 @@ Logger::Logger(const string &loggerName) {
_logger_name = loggerName;
_last_log = std::make_shared<LogContext>();
_default_channel = std::make_shared<ConsoleChannel>("default", LTrace);

#if defined(_WIN32)
SetConsoleOutputCP(CP_UTF8);
#endif
}

Logger::~Logger() {
Expand Down

0 comments on commit 78d4c1d

Please sign in to comment.