summaryrefslogtreecommitdiffstats
path: root/source/core/slang-std-writers.cpp
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2024-08-12 20:53:03 -0700
committerGitHub <noreply@github.com>2024-08-12 20:53:03 -0700
commitb390566b55700582321b09b72c726b8dff9bd819 (patch)
treea2fd8e50fcbde29dd2651e08a78021f2ae9d72de /source/core/slang-std-writers.cpp
parent20bd48659d0009de5477380c335e2419f4c66f8b (diff)
Support unicode identifier names. (#4772)
* Support unicode identifier names. * Fix. * Fix language server. * Fix build errors. * Fix. * Fix offset translation in language server.
Diffstat (limited to 'source/core/slang-std-writers.cpp')
-rw-r--r--source/core/slang-std-writers.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/source/core/slang-std-writers.cpp b/source/core/slang-std-writers.cpp
index a23d878fb..264f37c98 100644
--- a/source/core/slang-std-writers.cpp
+++ b/source/core/slang-std-writers.cpp
@@ -1,6 +1,10 @@
#include "slang-std-writers.h"
+#if SLANG_WINDOWS_FAMILY
+#include <Windows.h>
+#endif
+
namespace Slang
{
@@ -8,8 +12,11 @@ namespace Slang
/* static */RefPtr<StdWriters> StdWriters::createDefault()
{
+#if SLANG_WINDOWS_FAMILY
+ SetConsoleCP(CP_UTF8);
+ SetConsoleOutputCP(CP_UTF8);
+#endif
RefPtr<StdWriters> stdWriters(new StdWriters);
-
RefPtr<FileWriter> stdError(new FileWriter(stderr, WriterFlag::AutoFlush | WriterFlag::IsUnowned));
RefPtr<FileWriter> stdOut(new FileWriter(stdout, WriterFlag::AutoFlush | WriterFlag::IsUnowned));