diff --git a/internal/cli/cli_windows.go b/internal/cli/cli_windows.go index 1c8cf1fd53..4106498c60 100644 --- a/internal/cli/cli_windows.go +++ b/internal/cli/cli_windows.go @@ -3,10 +3,14 @@ package cli import "golang.org/x/sys/windows" func init() { - kernel32 := windows.NewLazySystemDLL("kernel32.dll") + setConsoleCP := kernel32.NewProc("SetConsoleCP") - // Set codepage to UTF-8 + // Set console input codepage to UTF-8 // https://learn.microsoft.com/en-us/windows/win32/intl/code-page-identifiers#:~:text=Unicode%20(UTF%2D7)-,65001,-utf%2D8 setConsoleCP.Call(uintptr(65001)) + + setConsoleOutputCP := kernel32.NewProc("SetConsoleOutputCP") + // Set console ouput codepage to UTF-8 + setConsoleOutputCP.Call(uintptr(65001)) }