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 }