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/collate: unexpected result of KeyFromString() #38726

Open
wjhuang2016 opened this issue Apr 28, 2020 · 1 comment
Open

x/text/collate: unexpected result of KeyFromString() #38726

wjhuang2016 opened this issue Apr 28, 2020 · 1 comment
Labels
NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone

Comments

@wjhuang2016
Copy link

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

$ go version
1.1.13

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
```
go env
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/bba/Library/Caches/go-build"
GOENV="/Users/bba/Library/Application Support/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GONOPROXY=""
GONOSUMDB=""
GOOS="darwin"
GOPATH="/Users/bba/.gvm/pkgsets/go1.13/global"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/Users/bba/.gvm/gos/go1.13"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/Users/bba/.gvm/gos/go1.13/pkg/tool/darwin_amd64"
GCCGO="gccgo"
AR="ar"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD="/Users/bba/text/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/tg/tb44y2693qd2s6j53chrywyw0000gn/T/go-build299346317=/tmp/go-build -gno-record-gcc-switches -fno-common"
```

What did you do?

https://play.golang.org/p/__hCo4kcE86

What did you expect to see?

str = bytesToString(ctor.KeyFromString(buf, "L·"))
println("", str) // 1711

The str will be "17110183" instead of "1711".

What did you see instead?

"1711"

@gopherbot gopherbot added this to the Unreleased milestone Apr 28, 2020
@andybons
Copy link
Member

@mpvl

@andybons andybons added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Apr 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Projects
None yet
Development

No branches or pull requests

3 participants