Skip to content

Commit

Permalink
win32: Set console codepage to UTF-8 (#2726)
Browse files Browse the repository at this point in the history
  • Loading branch information
alichay authored Oct 3, 2023
1 parent e553bbf commit 76f709c
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions internal/cli/cli_windows.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package cli

import "golang.org/x/sys/windows"

func init() {

kernel32 := windows.NewLazySystemDLL("kernel32.dll")
setConsoleCP := kernel32.NewProc("SetConsoleCP")
// Set 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))
}

0 comments on commit 76f709c

Please sign in to comment.