Files
podman/vendor/github.com/mattn/go-runewidth/runewidth_windows.go
renovate[bot] 6493343ddc Update module github.com/vbauerster/mpb/v8 to v8.11.1
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-11-07 10:36:01 +00:00

35 lines
608 B
Go

//go:build windows && !appengine
// +build windows,!appengine
package runewidth
import (
"os"
"syscall"
)
var (
kernel32 = syscall.NewLazyDLL("kernel32")
procGetConsoleOutputCP = kernel32.NewProc("GetConsoleOutputCP")
)
// IsEastAsian return true if the current locale is CJK
func IsEastAsian() bool {
if os.Getenv("WT_SESSION") != "" {
// Windows Terminal always not use East Asian Ambiguous Width(s).
return false
}
r1, _, _ := procGetConsoleOutputCP.Call()
if r1 == 0 {
return false
}
switch int(r1) {
case 932, 51932, 936, 949, 950:
return true
}
return false
}