From 2339fcd264de9aa0320a6834af92e072bb883aee Mon Sep 17 00:00:00 2001 From: insanity Date: Thu, 23 Aug 2018 18:29:29 +0900 Subject: [PATCH] gateway_windows : chcp 437 --- net/gateway/gateway_windows.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/net/gateway/gateway_windows.go b/net/gateway/gateway_windows.go index 685f2c2..7f923a4 100644 --- a/net/gateway/gateway_windows.go +++ b/net/gateway/gateway_windows.go @@ -6,8 +6,10 @@ import ( ) func DiscoverGateway() (ip net.IP, iface string, err error) { - routeCmd := exec.Command("route", "print", "0.0.0.0") - output, err := routeCmd.CombinedOutput() + output, err := exec.Command("cmd.exe", "/C", "chcp 437 && route print 0.0.0.0").CombinedOutput() + if err != nil { + panic(err) + } if err != nil { return nil, "", err }