aboutsummaryrefslogtreecommitdiff
path: root/vendor/github.com/mattn/go-runewidth/runewidth_windows.go
diff options
context:
space:
mode:
authorMitja Felicijan <mitja.felicijan@gmail.com>2026-01-21 20:22:09 +0100
committerMitja Felicijan <mitja.felicijan@gmail.com>2026-01-21 20:22:09 +0100
commit5a8dbc6347b3541e84fe669b22c17ad3b715e258 (patch)
treeb148c450939688caaaeb4adac6f2faa1eaffe649 /vendor/github.com/mattn/go-runewidth/runewidth_windows.go
downloadqwe-editor-5a8dbc6347b3541e84fe669b22c17ad3b715e258.tar.gz
Engage!
Diffstat (limited to 'vendor/github.com/mattn/go-runewidth/runewidth_windows.go')
-rw-r--r--vendor/github.com/mattn/go-runewidth/runewidth_windows.go28
1 files changed, 28 insertions, 0 deletions
diff --git a/vendor/github.com/mattn/go-runewidth/runewidth_windows.go b/vendor/github.com/mattn/go-runewidth/runewidth_windows.go
new file mode 100644
index 0000000..d6a6177
--- /dev/null
+++ b/vendor/github.com/mattn/go-runewidth/runewidth_windows.go
@@ -0,0 +1,28 @@
1// +build windows
2// +build !appengine
3
4package runewidth
5
6import (
7 "syscall"
8)
9
10var (
11 kernel32 = syscall.NewLazyDLL("kernel32")
12 procGetConsoleOutputCP = kernel32.NewProc("GetConsoleOutputCP")
13)
14
15// IsEastAsian return true if the current locale is CJK
16func IsEastAsian() bool {
17 r1, _, _ := procGetConsoleOutputCP.Call()
18 if r1 == 0 {
19 return false
20 }
21
22 switch int(r1) {
23 case 932, 51932, 936, 949, 950:
24 return true
25 }
26
27 return false
28}