diff options
author | Michael Muré <batolettre@gmail.com> | 2018-07-30 18:11:53 +0200 |
---|---|---|
committer | Michael Muré <batolettre@gmail.com> | 2018-07-30 18:11:53 +0200 |
commit | bb9168f98a9dd50a7215652ab77a1c46615064cd (patch) | |
tree | 8ee16c1b5c6078cd48427c799375b78c95749bcd /vendor/github.com/mattn/go-runewidth/runewidth_windows.go | |
parent | 29bb7364c8e873c72a386f4f6fa26248e5355cb2 (diff) | |
download | git-bug-bb9168f98a9dd50a7215652ab77a1c46615064cd.tar.gz |
vendor gocui
Diffstat (limited to 'vendor/github.com/mattn/go-runewidth/runewidth_windows.go')
-rw-r--r-- | vendor/github.com/mattn/go-runewidth/runewidth_windows.go | 25 |
1 files changed, 25 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 00000000..0258876b --- /dev/null +++ b/vendor/github.com/mattn/go-runewidth/runewidth_windows.go @@ -0,0 +1,25 @@ +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 +} |