diff options
Diffstat (limited to 'src/server')
| -rw-r--r-- | src/server/worldserver/CommandLine/CliRunnable.cpp | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/src/server/worldserver/CommandLine/CliRunnable.cpp b/src/server/worldserver/CommandLine/CliRunnable.cpp index 7b2624159ef..2d858c415d4 100644 --- a/src/server/worldserver/CommandLine/CliRunnable.cpp +++ b/src/server/worldserver/CommandLine/CliRunnable.cpp @@ -78,11 +78,7 @@ namespace Trinity::Impl::Readline void utf8print(void* /*arg*/, std::string_view str) { #if TRINITY_PLATFORM == TRINITY_PLATFORM_WINDOWS - std::wstring wbuf; - if (!Utf8toWStr(str, wbuf)) - return; - - wprintf(L"%s", wbuf.c_str()); + WriteWinConsole(str); #else { printf(STRING_VIEW_FMT, STRING_VIEW_FMT_ARG(str)); @@ -139,14 +135,10 @@ void CliThread() std::string command; #if TRINITY_PLATFORM == TRINITY_PLATFORM_WINDOWS - wchar_t commandbuf[256]; - if (fgetws(commandbuf, sizeof(commandbuf), stdin)) + if (!ReadWinConsole(command)) { - if (!WStrToUtf8(commandbuf, wcslen(commandbuf), command)) - { - PrintCliPrefix(); - continue; - } + PrintCliPrefix(); + continue; } #else char* command_str = readline(CLI_PREFIX); |
