blob: d6a61777d7b1c24d55a259f765b356f322e81edc [file] [log] [blame]
Anand S Katti09541352020-01-29 15:54:01 +05301// +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}