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

x/text/language: matcher incorrect handling of zh #32141

Open
diligiant opened this issue May 19, 2019 · 1 comment

Comments

@diligiant
Copy link

commented May 19, 2019

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

$ go version
go version go1.12.5 darwin/amd64

Does this issue reproduce with the latest release?

Yes

What operating system and processor architecture are you using (go env)?

go env Output
$ go env
GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/frederic/Library/Caches/go-build"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/frederic/.go"
GOPROXY=""
GORACE=""
GOROOT="/usr/local/Cellar/go/1.12.5/libexec"
GOTMPDIR=""
GOTOOLDIR="/usr/local/Cellar/go/1.12.5/libexec/pkg/tool/darwin_amd64"
GCCGO="gccgo"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD="/Users/frederic/Creative/src/wayke/backend/go.mod"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/h9/05jw9tbx44941w86t3ml3bmw0000gn/T/go-build309324644=/tmp/go-build -gno-record-gcc-switches -fno-common"

What did you do?

Building on CLDR LocalMatcher tests, I tested the case where both zh-CN and zh-HK are supported and zh-TW is desired. I switched CN and HK relative positions in supported.

https://play.golang.org/p/4bG57qBzNQr

What did you expect to see?

I expected zh-HK to be returned in both cases.

What did you see instead?

zh-HK is returned when HK is before CN in supported, en is returned when CN precedes HK.

@gopherbot gopherbot added this to the Unreleased milestone May 19, 2019

@ALTree

This comment has been minimized.

Copy link
Member

commented May 19, 2019

Thanks for reporting this.

cc @mpvl for investigation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.