unified output (#14) (#40)

This commit is contained in:
root360-AndreasUlm
2019-09-15 08:38:18 +00:00
committed by Gitea
parent 1d233402fd
commit 7c024bcd69
24 changed files with 2866 additions and 12 deletions

View File

@@ -0,0 +1,28 @@
// +build windows
// +build !appengine
package runewidth
import (
"syscall"
)
var (
kernel32 = syscall.NewLazyDLL("kernel32")
procGetConsoleOutputCP = kernel32.NewProc("GetConsoleOutputCP")
)
// IsEastAsian return true if the current locale is CJK
func IsEastAsian() bool {
r1, _, _ := procGetConsoleOutputCP.Call()
if r1 == 0 {
return false
}
switch int(r1) {
case 932, 51932, 936, 949, 950:
return true
}
return false
}