5
0
mirror of https://github.com/cwinfo/matterbridge.git synced 2024-12-28 00:55:39 +00:00
matterbridge/vendor/github.com/mattn/go-runewidth/runewidth_windows.go
Wim d16645c952
Update mattermost library (#2152)
* Update mattermost library

* Fix linting
2024-05-24 23:08:09 +02:00

29 lines
479 B
Go

//go:build windows && !appengine
// +build windows,!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
}