mirror of
https://github.com/opencloud-eu/opencloud.git
synced 2026-01-06 12:19:37 -06:00
Bumps [github.com/olekukonko/tablewriter](https://github.com/olekukonko/tablewriter) from 1.1.0 to 1.1.1. - [Commits](https://github.com/olekukonko/tablewriter/compare/v1.1.0...v1.1.1) --- updated-dependencies: - dependency-name: github.com/olekukonko/tablewriter dependency-version: 1.1.1 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com>
35 lines
608 B
Go
35 lines
608 B
Go
//go:build windows && !appengine
|
|
// +build windows,!appengine
|
|
|
|
package runewidth
|
|
|
|
import (
|
|
"os"
|
|
"syscall"
|
|
)
|
|
|
|
var (
|
|
kernel32 = syscall.NewLazyDLL("kernel32")
|
|
procGetConsoleOutputCP = kernel32.NewProc("GetConsoleOutputCP")
|
|
)
|
|
|
|
// IsEastAsian return true if the current locale is CJK
|
|
func IsEastAsian() bool {
|
|
if os.Getenv("WT_SESSION") != "" {
|
|
// Windows Terminal always not use East Asian Ambiguous Width(s).
|
|
return false
|
|
}
|
|
|
|
r1, _, _ := procGetConsoleOutputCP.Call()
|
|
if r1 == 0 {
|
|
return false
|
|
}
|
|
|
|
switch int(r1) {
|
|
case 932, 51932, 936, 949, 950:
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|