Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

time: TestLocalZoneAbbr fails on Windows in "W. Europe Standard Time" #12015

Closed
dajoo75 opened this issue Aug 4, 2015 · 18 comments

Comments

Projects
None yet
6 participants
@dajoo75
Copy link
Contributor

commented Aug 4, 2015

What version of Go are you using (go version)?

N/A, commit bc5a6ce.

What operating system and processor architecture are you using?

Windows 7, 64-bit.

What did you do?

Ran src/all.bat as administrator and with the firewall temporarily turned off

What did you expect to see?

All tests passing

What did you see instead?
##### Building Go bootstrap tool.
cmd/dist

##### Building Go toolchain using c:\home\installs\go_1.4.2.
...
##### Building go_bootstrap for host, windows/amd64.
...
##### Building packages and commands for windows/amd64.
...
##### Testing packages.
...
--- FAIL: TestClientTrailers (0.00s)
client_test.go:1116: Response trailers = http.Header{"Server-Trailer-A":[]string(nil), "Server-Trailer-B":[]string(nil)}; want http.Header{"Server-Trailer-A":[]string{"valuea"}, "Server-Trailer-B":[]string(nil), "Server-Trailer-C":[]string{"valuec"}}
FAIL
FAIL    net/http    8.134s
...
2015/08/04 19:51:18 Unsolicited response received on idle HTTP channel starting with "\r"; err=<nil>
--- FAIL: TestReverseProxy (0.09s)
reverseproxy_test.go:102: Trailer(X-Trailer) = "" ; want "trailer_value"
FAIL
FAIL    net/http/httputil   0.283s
...
--- FAIL: TestLocalZoneAbbr (0.00s)
zoneinfo_windows_test.go:19: Parse failed: parsing time "Tue, 04 Aug 2015 19:51:40 V" as "Mon, 02 Jan 2006 15:04:05 MST": cannot parse "V" as "MST"
FAIL
FAIL    time    3.018s
...
--- FAIL: TestLocalImportsEasySub (0.63s)
go_test.go:243: running testgo [build -o ./easysub.exe testdata\local\easysub\main.go]
go_test.go:150: remove ./easysub.exe: Access is denied.
FAIL
FAIL    cmd/go  48.210s
...
2015/08/04 19:52:33 Failed: exit status 1

@ianlancetaylor ianlancetaylor added this to the Go1.5 milestone Aug 4, 2015

@bradfitz

This comment has been minimized.

Copy link
Member

commented Aug 4, 2015

The http errors make me suspect a local http proxy/firewall. We've seen similar errors in the past where disabling some antivirus or firewall fixed the mangling of http test traffic.

@dajoo75

This comment has been minimized.

Copy link
Contributor Author

commented Aug 4, 2015

Hi Brad! I ran all.bat again with the firewall and my antivirus software disabled but I'm still seeing the same test failures.

@bradfitz

This comment has been minimized.

Copy link
Member

commented Aug 4, 2015

Maybe the firewall is "disabled" and trying its best not to modify or judge traffic but its hooks and buggy interception are still active, thinking they're inert but failing to be transparent. I don't know.

Which antivirus is disabled?

/cc @alexbrainman

@dajoo75

This comment has been minimized.

Copy link
Contributor Author

commented Aug 4, 2015

ESET Nod32 Antivirus, v8.0.312.3

@bradfitz

This comment has been minimized.

Copy link
Member

commented Aug 4, 2015

Could you entertain me and uninstall it, reboot, and try again?

@dajoo75

This comment has been minimized.

Copy link
Contributor Author

commented Aug 4, 2015

On it.

@dajoo75

This comment has been minimized.

Copy link
Contributor Author

commented Aug 4, 2015

After uninstalling Nod32 and disabling the firewall all tests but one now passes:

--- FAIL: TestLocalZoneAbbr (0.00s) 
zoneinfo_windows_test.go:19: Parse failed: parsing time "Tue, 04 Aug 2015 19:51:40 V" as "Mon, 02 Jan 2006 15:04:05 MST": cannot parse "V" as "MST"
FAIL
FAIL    time    3.018s
@bradfitz

This comment has been minimized.

Copy link
Member

commented Aug 4, 2015

What is your machine's timezone? That might be a real bug.

@dajoo75

This comment has been minimized.

Copy link
Contributor Author

commented Aug 4, 2015

$ tzutil /g
W. Europe Standard Time

@ianlancetaylor ianlancetaylor changed the title build: all.bat: Test failures for Go 1.5 tip (commit bc5a6ce) on Windows 7 (64-bit) time: TestLocalZoneAbbr fails on Windows in "W. Europe Standard Time" Aug 4, 2015

@rsc

This comment has been minimized.

Copy link
Contributor

commented Aug 4, 2015

Too late for Go 1.5.

@rsc rsc modified the milestones: Go1.6, Go1.5 Aug 4, 2015

@alexbrainman

This comment has been minimized.

Copy link
Member

commented Aug 12, 2015

@dajoo75 please run this program http://play.golang.org/p/krOLuFmPJp and provide its output here. Thank you.

Ale

@dajoo75

This comment has been minimized.

Copy link
Contributor Author

commented Aug 12, 2015

Here you go:

syscall.Timezoneinformation{Bias:-60, StandardName:[32]uint16{0x56, 0xe4, 0x73, 0x74, 0x65, 0x75, 0x72, 0x6f, 0x70, 0x61, 0x2c, 0x20, 0x6e, 0x6f, 0x72, 0x6d, 0x61, 0x6c, 0x74, 0x69, 0x64, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, StandardDate:syscall.Systemtime{Year:0x0, Month:0xa, DayOfWeek:0x0, Day:0x5, Hour:0x3, Minute:0x0, Second:0x0, Milliseconds:0x0}, StandardBias:0, DaylightName:[32]uint16{0x56, 0xe4, 0x73, 0x74, 0x65, 0x75, 0x72, 0x6f, 0x70, 0x61, 0x2c, 0x20, 0x73, 0x6f, 0x6d, 0x6d, 0x61, 0x72, 0x74, 0x69, 0x64, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, DaylightDate:syscall.Systemtime{Year:0x0, Month:0x3, DayOfWeek:0x0, Day:0x5, Hour:0x2, Minute:0x0, Second:0x0, Milliseconds:0x0}, DaylightBias:-60}
@alexbrainman

This comment has been minimized.

Copy link
Member

commented Aug 13, 2015

@dajoo75 thank you.

Your syscall.GetTimeZoneInformation seems to return "Västeuropa, normaltid" and "Västeuropa, sommartid" for your time-zone descriptions. Go struggle to convert these into time-zone. What it does, it looks for appropriate registry key under HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones. Perhaps you can follow code in zoneinfo_windows.go to see where it fails. Just insert some print statements here and there. Something like that:

diff --git a/src/time/zoneinfo_windows.go b/src/time/zoneinfo_windows.go
index d04ebec..0f1066d 100644
--- a/src/time/zoneinfo_windows.go
+++ b/src/time/zoneinfo_windows.go
@@ -61,6 +61,7 @@ func toEnglishName(stdname, dstname string) (string, error) {
    }
    for _, name := range names {
        matched, err := matchZoneKey(k, name, stdname, dstname)
+       println("ALEX3: ", name, matched, err)
        if err == nil && matched {
            return name, nil
        }
@@ -83,10 +84,12 @@ func extractCAPS(desc string) string {
 func abbrev(z *syscall.Timezoneinformation) (std, dst string) {
    stdName := syscall.UTF16ToString(z.StandardName[:])
    a, ok := abbrs[stdName]
+   println("ALEX1: ", stdName, ok)
    if !ok {
        dstName := syscall.UTF16ToString(z.DaylightName[:])
        // Perhaps stdName is not English. Try to convert it.
        englishName, err := toEnglishName(stdName, dstName)
+       println("ALEX2: ", englishName, err.Error())
        if err == nil {
            a, ok = abbrs[englishName]
            if ok {

Then just run

go test -run=TestLocalZoneAbbr time

command to see what is going on.

Thank you.

Alex

@dajoo75

This comment has been minimized.

Copy link
Contributor Author

commented Aug 13, 2015

Hi Alex!

I've done some digging and as far as I can see the function toEnglishName (zoneinfo_windows.go) doesn't take into account MUI or Multilingual User Interface information in the registry (MUI_Std and MUI_Dlt points to localized resource strings for timezones stored in tzres.dll) and that is why it is failing to find a match for "Västeuropa, normaltid" and "Västeuropa, sommartid" (Swedish).

Some information I found while researching this:
http://blogs.msdn.com/b/bclteam/archive/2007/06/07/exploring-windows-time-zones-with-system-timezoneinfo-josh-free.aspx
https://stackoverflow.com/questions/9324563/how-does-one-read-a-localized-name-from-the-registry

Here's an example program I put together (RegLoadMUIString is not in the example) that can extract the localized resource strings (at least on my computer ;-)):

/*
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\W. Europe Standard Time]
"MUI_Display"="@tzres.dll,-320"
"MUI_Dlt"="@tzres.dll,-321"
"MUI_Std"="@tzres.dll,-322"
"Display"="(UTC+01:00) Amsterdam, Berlin, Bern, Rome, Stockholm, Vienna"
"Dlt"="W. Europe Daylight Time"
"Std"="W. Europe Standard Time"
 "TZI"=hex:c4,ff,ff,ff,00,00,00,00,c4,ff,ff,ff,00,00,0a,00,00,00,05,00,03,00,00,00,00,00,00,00,00,00,03,00,00,00,05,00,02,00,00,00,00,00,00,00
*/

package main

import (
"fmt"
"syscall"
"unsafe"
)

var (
tzresDLL       = syscall.NewLazyDLL("tzres")
user32DLL      = syscall.NewLazyDLL("user32")
procLoadString = user32DLL.NewProc("LoadStringW")
)

func main() {
fmt.Println(muiString(321))
fmt.Println(muiString(322))
}

func muiString(id uint32) string {
buf := make([]uint16, 1024)
_, _, e0 := syscall.Syscall6(
    procLoadString.Addr(),
    4,
    tzresDLL.Handle(),
    uintptr(id),
    uintptr(unsafe.Pointer(&buf[0])),
    uintptr(len(buf)),
    0,
    0)

if e0 != 0 {
    return ""
}

return syscall.UTF16ToString(buf)
}

Example output on my computer:

$ go run timezone3.go
Västeuropa, sommartid
Västeuropa, normaltid

And here are also the traces you requested:

  $ go test -run=TestLocalZoneAbbr time
  OK   abbrev: abbrs[ Pacific Standard Time ] => { PST PDT } true
  FAIL abbrev: abbrs[ Västeuropa, normaltid ] => {   } false
     toEnglishName: starting. Trying to convert stdname( Västeuropa, normaltid ) and dstname( Västeuropa, sommartid ) to english...
     FAIL toEnglishName: matchZoneKey( 164 , Afghanistan Standard Time , Västeuropa, normaltid , Västeuropa, sommartid )  =>  false (0x0,0x0)
     FAIL toEnglishName: matchZoneKey( 164 , Alaskan Standard Time , Västeuropa, normaltid , Västeuropa, sommartid )      =>  false (0x0,0x0)
     FAIL toEnglishName: matchZoneKey( 164 , Arab Standard Time , Västeuropa, normaltid , Västeuropa, sommartid ) =>  false (0x0,0x0)
     FAIL toEnglishName: matchZoneKey( 164 , Arabian Standard Time , Västeuropa, normaltid , Västeuropa, sommartid )      =>  false (0x0,0x0)
     FAIL toEnglishName: matchZoneKey( 164 , Arabic Standard Time , Västeuropa, normaltid , Västeuropa, sommartid )       =>  false (0x0,0x0)
     FAIL toEnglishName: matchZoneKey( 164 , Argentina Standard Time , Västeuropa, normaltid , Västeuropa, sommartid )    =>  false (0x0,0x0)
     FAIL toEnglishName: matchZoneKey( 164 , Atlantic Standard Time , Västeuropa, normaltid , Västeuropa, sommartid )     =>  false (0x0,0x0)
     FAIL toEnglishName: matchZoneKey( 164 , AUS Central Standard Time , Västeuropa, normaltid , Västeuropa, sommartid )  =>  false (0x0,0x0)
     FAIL toEnglishName: matchZoneKey( 164 , AUS Eastern Standard Time , Västeuropa, normaltid , Västeuropa, sommartid )  =>  false (0x0,0x0)
     FAIL toEnglishName: matchZoneKey( 164 , Azerbaijan Standard Time , Västeuropa, normaltid , Västeuropa, sommartid )   =>  false (0x0,0x0)
     FAIL toEnglishName: matchZoneKey( 164 , Azores Standard Time , Västeuropa, normaltid , Västeuropa, sommartid )       =>  false (0x0,0x0)
     FAIL toEnglishName: matchZoneKey( 164 , Bahia Standard Time , Västeuropa, normaltid , Västeuropa, sommartid )        =>  false (0x0,0x0)
     FAIL toEnglishName: matchZoneKey( 164 , Bangladesh Standard Time , Västeuropa, normaltid , Västeuropa, sommartid )   =>  false (0x0,0x0)
     FAIL toEnglishName: matchZoneKey( 164 , Belarus Standard Time , Västeuropa, normaltid , Västeuropa, sommartid )      =>  false (0x0,0x0)
     FAIL toEnglishName: matchZoneKey( 164 , Canada Central Standard Time , Västeuropa, normaltid , Västeuropa, sommartid )       =>  false (0x0,0x0)
     FAIL toEnglishName: matchZoneKey( 164 , Cape Verde Standard Time , Västeuropa, normaltid , Västeuropa, sommartid )   =>  false (0x0,0x0)
     FAIL toEnglishName: matchZoneKey( 164 , Caucasus Standard Time , Västeuropa, normaltid , Västeuropa, sommartid )     =>  false (0x0,0x0)
     FAIL toEnglishName: matchZoneKey( 164 , Cen. Australia Standard Time , Västeuropa, normaltid , Västeuropa, sommartid )       =>  false (0x0,0x0)
     FAIL toEnglishName: matchZoneKey( 164 , Central America Standard Time , Västeuropa, normaltid , Västeuropa, sommartid )      =>  false (0x0,0x0)
     FAIL toEnglishName: matchZoneKey( 164 , Central Asia Standard Time , Västeuropa, normaltid , Västeuropa, sommartid ) =>  false (0x0,0x0)
     FAIL toEnglishName: matchZoneKey( 164 , Central Brazilian Standard Time , Västeuropa, normaltid , Västeuropa, sommartid )    =>  false (0x0,0x0)
     FAIL toEnglishName: matchZoneKey( 164 , Central Europe Standard Time , Västeuropa, normaltid , Västeuropa, sommartid )       =>  false (0x0,0x0)
     FAIL toEnglishName: matchZoneKey( 164 , Central European Standard Time , Västeuropa, normaltid , Västeuropa, sommartid )     =>  false (0x0,0x0)
     FAIL toEnglishName: matchZoneKey( 164 , Central Pacific Standard Time , Västeuropa, normaltid , Västeuropa, sommartid )      =>  false (0x0,0x0)
     FAIL toEnglishName: matchZoneKey( 164 , Central Standard Time , Västeuropa, normaltid , Västeuropa, sommartid )      =>  false (0x0,0x0)
     FAIL toEnglishName: matchZoneKey( 164 , Central Standard Time (Mexico) , Västeuropa, normaltid , Västeuropa, sommartid )     =>  false (0x0,0x0)
     FAIL toEnglishName: matchZoneKey( 164 , China Standard Time , Västeuropa, normaltid , Västeuropa, sommartid )        =>  false (0x0,0x0)
     FAIL toEnglishName: matchZoneKey( 164 , Dateline Standard Time , Västeuropa, normaltid , Västeuropa, sommartid )     =>  false (0x0,0x0)
     FAIL toEnglishName: matchZoneKey( 164 , E. Africa Standard Time , Västeuropa, normaltid , Västeuropa, sommartid )    =>  false (0x0,0x0)
     FAIL toEnglishName: matchZoneKey( 164 , E. Australia Standard Time , Västeuropa, normaltid , Västeuropa, sommartid ) =>  false (0x0,0x0)
     FAIL toEnglishName: matchZoneKey( 164 , E. Europe Standard Time , Västeuropa, normaltid , Västeuropa, sommartid )    =>  false (0x0,0x0)
     FAIL toEnglishName: matchZoneKey( 164 , E. South America Standard Time , Västeuropa, normaltid , Västeuropa, sommartid )     =>  false (0x0,0x0)
     FAIL toEnglishName: matchZoneKey( 164 , Eastern Standard Time , Västeuropa, normaltid , Västeuropa, sommartid )      =>  false (0x0,0x0)
     FAIL toEnglishName: matchZoneKey( 164 , Egypt Standard Time , Västeuropa, normaltid , Västeuropa, sommartid )        =>  false (0x0,0x0)
     FAIL toEnglishName: matchZoneKey( 164 , Ekaterinburg Standard Time , Västeuropa, normaltid , Västeuropa, sommartid ) =>  false (0x0,0x0)
     FAIL toEnglishName: matchZoneKey( 164 , Fiji Standard Time , Västeuropa, normaltid , Västeuropa, sommartid ) =>  false (0x0,0x0)
     FAIL toEnglishName: matchZoneKey( 164 , FLE Standard Time , Västeuropa, normaltid , Västeuropa, sommartid )  =>  false (0x0,0x0)
     FAIL toEnglishName: matchZoneKey( 164 , Georgian Standard Time , Västeuropa, normaltid , Västeuropa, sommartid )     =>  false (0x0,0x0)
     FAIL toEnglishName: matchZoneKey( 164 , GMT Standard Time , Västeuropa, normaltid , Västeuropa, sommartid )  =>  false (0x0,0x0)
     FAIL toEnglishName: matchZoneKey( 164 , Greenland Standard Time , Västeuropa, normaltid , Västeuropa, sommartid )    =>  false (0x0,0x0)
     FAIL toEnglishName: matchZoneKey( 164 , Greenwich Standard Time , Västeuropa, normaltid , Västeuropa, sommartid )    =>  false (0x0,0x0)
     FAIL toEnglishName: matchZoneKey( 164 , GTB Standard Time , Västeuropa, normaltid , Västeuropa, sommartid )  =>  false (0x0,0x0)
     FAIL toEnglishName: matchZoneKey( 164 , Hawaiian Standard Time , Västeuropa, normaltid , Västeuropa, sommartid )     =>  false (0x0,0x0)
     FAIL toEnglishName: matchZoneKey( 164 , India Standard Time , Västeuropa, normaltid , Västeuropa, sommartid )        =>  false (0x0,0x0)
     FAIL toEnglishName: matchZoneKey( 164 , Iran Standard Time , Västeuropa, normaltid , Västeuropa, sommartid ) =>  false (0x0,0x0)
     FAIL toEnglishName: matchZoneKey( 164 , Israel Standard Time , Västeuropa, normaltid , Västeuropa, sommartid )       =>  false (0x0,0x0)
     FAIL toEnglishName: matchZoneKey( 164 , Jordan Standard Time , Västeuropa, normaltid , Västeuropa, sommartid )       =>  false (0x0,0x0)
     FAIL toEnglishName: matchZoneKey( 164 , Kaliningrad Standard Time , Västeuropa, normaltid , Västeuropa, sommartid )  =>  false (0x0,0x0)
     FAIL toEnglishName: matchZoneKey( 164 , Kamchatka Standard Time , Västeuropa, normaltid , Västeuropa, sommartid )    =>  false (0x0,0x0)
     FAIL toEnglishName: matchZoneKey( 164 , Korea Standard Time , Västeuropa, normaltid , Västeuropa, sommartid )        =>  false (0x0,0x0)
     FAIL toEnglishName: matchZoneKey( 164 , Libya Standard Time , Västeuropa, normaltid , Västeuropa, sommartid )        =>  false (0x0,0x0)
     FAIL toEnglishName: matchZoneKey( 164 , Line Islands Standard Time , Västeuropa, normaltid , Västeuropa, sommartid ) =>  false (0x0,0x0)
     FAIL toEnglishName: matchZoneKey( 164 , Magadan Standard Time , Västeuropa, normaltid , Västeuropa, sommartid )      =>  false (0x0,0x0)
     FAIL toEnglishName: matchZoneKey( 164 , Mauritius Standard Time , Västeuropa, normaltid , Västeuropa, sommartid )    =>  false (0x0,0x0)
     FAIL toEnglishName: matchZoneKey( 164 , Mid-Atlantic Standard Time , Västeuropa, normaltid , Västeuropa, sommartid ) =>  false (0x0,0x0)
     FAIL toEnglishName: matchZoneKey( 164 , Middle East Standard Time , Västeuropa, normaltid , Västeuropa, sommartid )  =>  false (0x0,0x0)
     FAIL toEnglishName: matchZoneKey( 164 , Montevideo Standard Time , Västeuropa, normaltid , Västeuropa, sommartid )   =>  false (0x0,0x0)
     FAIL toEnglishName: matchZoneKey( 164 , Morocco Standard Time , Västeuropa, normaltid , Västeuropa, sommartid )      =>  false (0x0,0x0)
     FAIL toEnglishName: matchZoneKey( 164 , Mountain Standard Time , Västeuropa, normaltid , Västeuropa, sommartid )     =>  false (0x0,0x0)
     FAIL toEnglishName: matchZoneKey( 164 , Mountain Standard Time (Mexico) , Västeuropa, normaltid , Västeuropa, sommartid )    =>  false (0x0,0x0)
     FAIL toEnglishName: matchZoneKey( 164 , Myanmar Standard Time , Västeuropa, normaltid , Västeuropa, sommartid )      =>  false (0x0,0x0)
     FAIL toEnglishName: matchZoneKey( 164 , N. Central Asia Standard Time , Västeuropa, normaltid , Västeuropa, sommartid )      =>  false (0x0,0x0)
     FAIL toEnglishName: matchZoneKey( 164 , Namibia Standard Time , Västeuropa, normaltid , Västeuropa, sommartid )      =>  false (0x0,0x0)
     FAIL toEnglishName: matchZoneKey( 164 , Nepal Standard Time , Västeuropa, normaltid , Västeuropa, sommartid )        =>  false (0x0,0x0)
     FAIL toEnglishName: matchZoneKey( 164 , New Zealand Standard Time , Västeuropa, normaltid , Västeuropa, sommartid )  =>  false (0x0,0x0)
     FAIL toEnglishName: matchZoneKey( 164 , Newfoundland Standard Time , Västeuropa, normaltid , Västeuropa, sommartid ) =>  false (0x0,0x0)
     FAIL toEnglishName: matchZoneKey( 164 , North Asia East Standard Time , Västeuropa, normaltid , Västeuropa, sommartid )      =>  false (0x0,0x0)
     FAIL toEnglishName: matchZoneKey( 164 , North Asia Standard Time , Västeuropa, normaltid , Västeuropa, sommartid )   =>  false (0x0,0x0)
     FAIL toEnglishName: matchZoneKey( 164 , Pacific SA Standard Time , Västeuropa, normaltid , Västeuropa, sommartid )   =>  false (0x0,0x0)
     FAIL toEnglishName: matchZoneKey( 164 , Pacific Standard Time , Västeuropa, normaltid , Västeuropa, sommartid )      =>  false (0x0,0x0)
     FAIL toEnglishName: matchZoneKey( 164 , Pacific Standard Time (Mexico) , Västeuropa, normaltid , Västeuropa, sommartid )     =>  false (0x0,0x0)
     FAIL toEnglishName: matchZoneKey( 164 , Pakistan Standard Time , Västeuropa, normaltid , Västeuropa, sommartid )     =>  false (0x0,0x0)
     FAIL toEnglishName: matchZoneKey( 164 , Paraguay Standard Time , Västeuropa, normaltid , Västeuropa, sommartid )     =>  false (0x0,0x0)
     FAIL toEnglishName: matchZoneKey( 164 , Romance Standard Time , Västeuropa, normaltid , Västeuropa, sommartid )      =>  false (0x0,0x0)
     FAIL toEnglishName: matchZoneKey( 164 , Russia Time Zone 10 , Västeuropa, normaltid , Västeuropa, sommartid )        =>  false (0x0,0x0)
     FAIL toEnglishName: matchZoneKey( 164 , Russia Time Zone 11 , Västeuropa, normaltid , Västeuropa, sommartid )        =>  false (0x0,0x0)
     FAIL toEnglishName: matchZoneKey( 164 , Russia Time Zone 3 , Västeuropa, normaltid , Västeuropa, sommartid ) =>  false (0x0,0x0)
     FAIL toEnglishName: matchZoneKey( 164 , Russian Standard Time , Västeuropa, normaltid , Västeuropa, sommartid )      =>  false (0x0,0x0)
     FAIL toEnglishName: matchZoneKey( 164 , SA Eastern Standard Time , Västeuropa, normaltid , Västeuropa, sommartid )   =>  false (0x0,0x0)
     FAIL toEnglishName: matchZoneKey( 164 , SA Pacific Standard Time , Västeuropa, normaltid , Västeuropa, sommartid )   =>  false (0x0,0x0)
     FAIL toEnglishName: matchZoneKey( 164 , SA Western Standard Time , Västeuropa, normaltid , Västeuropa, sommartid )   =>  false (0x0,0x0)
     FAIL toEnglishName: matchZoneKey( 164 , Samoa Standard Time , Västeuropa, normaltid , Västeuropa, sommartid )        =>  false (0x0,0x0)
     FAIL toEnglishName: matchZoneKey( 164 , SE Asia Standard Time , Västeuropa, normaltid , Västeuropa, sommartid )      =>  false (0x0,0x0)
     FAIL toEnglishName: matchZoneKey( 164 , Singapore Standard Time , Västeuropa, normaltid , Västeuropa, sommartid )    =>  false (0x0,0x0)
     FAIL toEnglishName: matchZoneKey( 164 , South Africa Standard Time , Västeuropa, normaltid , Västeuropa, sommartid ) =>  false (0x0,0x0)
     FAIL toEnglishName: matchZoneKey( 164 , Sri Lanka Standard Time , Västeuropa, normaltid , Västeuropa, sommartid )    =>  false (0x0,0x0)
     FAIL toEnglishName: matchZoneKey( 164 , Syria Standard Time , Västeuropa, normaltid , Västeuropa, sommartid )        =>  false (0x0,0x0)
     FAIL toEnglishName: matchZoneKey( 164 , Taipei Standard Time , Västeuropa, normaltid , Västeuropa, sommartid )       =>  false (0x0,0x0)
     FAIL toEnglishName: matchZoneKey( 164 , Tasmania Standard Time , Västeuropa, normaltid , Västeuropa, sommartid )     =>  false (0x0,0x0)
     FAIL toEnglishName: matchZoneKey( 164 , Tokyo Standard Time , Västeuropa, normaltid , Västeuropa, sommartid )        =>  false (0x0,0x0)
     FAIL toEnglishName: matchZoneKey( 164 , Tonga Standard Time , Västeuropa, normaltid , Västeuropa, sommartid )        =>  false (0x0,0x0)
     FAIL toEnglishName: matchZoneKey( 164 , Turkey Standard Time , Västeuropa, normaltid , Västeuropa, sommartid )       =>  false (0x0,0x0)
     FAIL toEnglishName: matchZoneKey( 164 , Ulaanbaatar Standard Time , Västeuropa, normaltid , Västeuropa, sommartid )  =>  false (0x0,0x0)
     FAIL toEnglishName: matchZoneKey( 164 , US Eastern Standard Time , Västeuropa, normaltid , Västeuropa, sommartid )   =>  false (0x0,0x0)
     FAIL toEnglishName: matchZoneKey( 164 , US Mountain Standard Time , Västeuropa, normaltid , Västeuropa, sommartid )  =>  false (0x0,0x0)
     FAIL toEnglishName: matchZoneKey( 164 , UTC , Västeuropa, normaltid , Västeuropa, sommartid )    =>  false (0x0,0x0)
     FAIL toEnglishName: matchZoneKey( 164 , UTC+12 , Västeuropa, normaltid , Västeuropa, sommartid ) =>  false (0x0,0x0)
     FAIL toEnglishName: matchZoneKey( 164 , UTC-02 , Västeuropa, normaltid , Västeuropa, sommartid ) =>  false (0x0,0x0)
     FAIL toEnglishName: matchZoneKey( 164 , UTC-11 , Västeuropa, normaltid , Västeuropa, sommartid ) =>  false (0x0,0x0)
     FAIL toEnglishName: matchZoneKey( 164 , Venezuela Standard Time , Västeuropa, normaltid , Västeuropa, sommartid )    =>  false (0x0,0x0)
     FAIL toEnglishName: matchZoneKey( 164 , Vladivostok Standard Time , Västeuropa, normaltid , Västeuropa, sommartid )  =>  false (0x0,0x0)
     FAIL toEnglishName: matchZoneKey( 164 , W. Australia Standard Time , Västeuropa, normaltid , Västeuropa, sommartid ) =>  false (0x0,0x0)
     FAIL toEnglishName: matchZoneKey( 164 , W. Central Africa Standard Time , Västeuropa, normaltid , Västeuropa, sommartid )    =>  false (0x0,0x0)
     FAIL toEnglishName: matchZoneKey( 164 , W. Europe Standard Time , Västeuropa, normaltid , Västeuropa, sommartid )    =>  false (0x0,0x0)
     FAIL toEnglishName: matchZoneKey( 164 , West Asia Standard Time , Västeuropa, normaltid , Västeuropa, sommartid )    =>  false (0x0,0x0)
     FAIL toEnglishName: matchZoneKey( 164 , West Pacific Standard Time , Västeuropa, normaltid , Västeuropa, sommartid ) =>  false (0x0,0x0)
     FAIL toEnglishName: matchZoneKey( 164 , Yakutsk Standard Time , Västeuropa, normaltid , Västeuropa, sommartid )      =>  false (0x0,0x0)
  FAIL abbrev: toEnglishName( Västeuropa, normaltid , Västeuropa, sommartid ) =>   English name for time zone "Västeuropa, normaltid" not found in registry
  OK   abbrev: abbrs[ Pacific Standard Time ] => { PST PDT } true
  --- FAIL: TestLocalZoneAbbr (0.01s)
          zoneinfo_windows_test.go:19: Parse failed: parsing time "Thu, 13 Aug 2015 23:43:41 V" as "Mon, 02 Jan 2006 15:04:05 MST": cannot parse "V" as "MST"
  FAIL
  FAIL    time    0.042s
@alexbrainman

This comment has been minimized.

Copy link
Member

commented Aug 14, 2015

Nice explanation, thank you very much. I use English version of Windows. So I don't get to play with all these things. My loss.

I think we should use RegLoadMUIString to here. I tried using RegLoadMUIString on my windows 7 pc, but it fails with ERROR_INVALID_DATA. I will play some more.

If RegLoadMUIString does not work for me, perhaps we can do something similar to your code. We should also call ExpandString in case there are some environment variables to expand.

Feel free to send change if you like. But no pressure, I will do it myself, if no one else wants to do it.

Alex

@dajoo75

This comment has been minimized.

Copy link
Contributor Author

commented Aug 23, 2015

@gopherbot

This comment has been minimized.

Copy link

commented Aug 23, 2015

CL https://golang.org/cl/13854 mentions this issue.

@gopherbot

This comment has been minimized.

Copy link

commented Aug 27, 2015

CL https://golang.org/cl/13929 mentions this issue.

robpike added a commit that referenced this issue Aug 28, 2015

registry: Explain how GetMUIStringValue works and where it falls short
GetMUIStringValue tries as a convenience to resolve string values even for pathless
resource DLLs by searching the system directory (one of several paths used
by the system's standard DLL search order algorithm). This would not be
needed if regLoadMUIString searched for pathless DLLs itself, but it
doesn't, instead it needs an absolute path, otherwise it will fail.

This approach works fine for solving issue #12015 (handle localized time
zone names; for which GetMUIStringValue was created) since tzres.dll that
is used to resolve localized time zone names has no path in the registry
but is located under the system directory.

However, this approach will fail if a pathless DLL is located somewhere
else than the system directory.

Because of this limitation GetMUIStringValue may have to be revised in the
future to allow for custom paths, possibly through another version of the
function.

See also:
https://msdn.microsoft.com/en-us/library/windows/desktop/ms724890%28v=vs.85%29.aspx
https://msdn.microsoft.com/en-us/library/windows/desktop/ms682586%28v=vs.85%29.aspx

Change-Id: Ida66a0ef1928e0461ce248c795827902d785e6cd
Reviewed-on: https://go-review.googlesource.com/13929
Reviewed-by: Rob Pike <r@golang.org>

@golang golang locked and limited conversation to collaborators Sep 4, 2016

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
You can’t perform that action at this time.