-
Notifications
You must be signed in to change notification settings - Fork 17.9k
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
cmd/go: "go: stripping unprintable or unescapable characters from ..." for seemingly printable characters #71863
Comments
I wonder if this comes from Windows being in GB or Big5 (is that possible?) |
This seemed pretty straightforward to reproduce in both PowerShell (Core) and Windows PowerShell with OCR to grab a repro-ing string from the screenshot. Oddly (to me) it doesn't happen when telling
( |
Looks like it comes from CL 488375 for #58570 for _, c := range []byte(s) {
if c == '\r' || c == '\n' || (!unicode.IsGraphic(rune(c)) && !unicode.IsSpace(rune(c))) { I'm not sure if it's ok to just switch iteration to be runes over a string? |
@prattmic @seankhliao @dagood code page 936PS C:\Users\陈杰> chcp 活动代码页: 936 PS C:\Users\陈杰> go env set AR=ar set CC=gcc set CGO_CFLAGS=-O2 -g set CGO_CPPFLAGS= set CGO_CXXFLAGS=-O2 -g set CGO_ENABLED=1 set CGO_FFLAGS=-O2 -g set CGO_LDFLAGS=-O2 -g set CXX=g++ set GCCGO=gccgo set GO111MODULE= set GOAMD64=v1 set GOARCH=amd64 set GOAUTH=netrc go: stripping unprintable or unescapable characters from %"GOBIN"% set GOBIN=C:\Users\������\Desktop\Go\bin go: stripping unprintable or unescapable characters from %"GOCACHE"% set GOCACHE=C:\Users\������\Desktop\Go\cache set GOCACHEPROG= set GODEBUG= go: stripping unprintable or unescapable characters from %"GOENV"% set GOENV=C:\Users\������\AppData\Roaming\go\env set GOEXE=.exe set GOEXPERIMENT= set GOFIPS140=off set GOFLAGS= go: stripping unprintable or unescapable characters from %"GOGCCFLAGS"% set GOGCCFLAGS=-m64 -mthreads -Wl,--no-gc-sections -fmessage-length=0 -ffile-prefix-map=C:\Users\������\AppData\Local\Temp\go-build1782176678=/tmp/go-build -gno-record-gcc-switches set GOHOSTARCH=amd64 set GOHOSTOS=windows set GOINSECURE= set GOMOD=NUL go: stripping unprintable or unescapable characters from %"GOMODCACHE"% set GOMODCACHE=C:\Users\������\Desktop\Go\pkg\mod set GONOPROXY= set GONOSUMDB= set GOOS=windows go: stripping unprintable or unescapable characters from %"GOPATH"% set GOPATH=C:\Users\������\Desktop\Go set GOPRIVATE= set GOPROXY=direct set GOROOT=C:\Program Files\Go set GOSUMDB=off set GOTELEMETRY=local go: stripping unprintable or unescapable characters from %"GOTELEMETRYDIR"% set GOTELEMETRYDIR=C:\Users\������\AppData\Roaming\go\telemetry set GOTMPDIR= set GOTOOLCHAIN=auto set GOTOOLDIR=C:\Program Files\Go\pkg\tool\windows_amd64 set GOVCS= set GOVERSION=go1.24.0 set GOWORK= set PKG_CONFIG=pkg-config code page 65001Active code page: 65001 PS C:\Users\陈杰> go env set AR=ar set CC=gcc set CGO_CFLAGS=-O2 -g set CGO_CPPFLAGS= set CGO_CXXFLAGS=-O2 -g set CGO_ENABLED=1 set CGO_FFLAGS=-O2 -g set CGO_LDFLAGS=-O2 -g set CXX=g++ set GCCGO=gccgo set GO111MODULE= set GOAMD64=v1 set GOARCH=amd64 set GOAUTH=netrc go: stripping unprintable or unescapable characters from %"GOBIN"% set GOBIN=C:\Users\������\Desktop\Go\bin go: stripping unprintable or unescapable characters from %"GOCACHE"% set GOCACHE=C:\Users\������\Desktop\Go\cache set GOCACHEPROG= set GODEBUG= go: stripping unprintable or unescapable characters from %"GOENV"% set GOENV=C:\Users\������\AppData\Roaming\go\env set GOEXE=.exe set GOEXPERIMENT= set GOFIPS140=off set GOFLAGS= go: stripping unprintable or unescapable characters from %"GOGCCFLAGS"% set GOGCCFLAGS=-m64 -mthreads -Wl,--no-gc-sections -fmessage-length=0 -ffile-prefix-map=C:\Users\������\AppData\Local\Temp\go-build2925785997=/tmp/go-build -gno-record-gcc-switches set GOHOSTARCH=amd64 set GOHOSTOS=windows set GOINSECURE= set GOMOD=NUL go: stripping unprintable or unescapable characters from %"GOMODCACHE"% set GOMODCACHE=C:\Users\������\Desktop\Go\pkg\mod set GONOPROXY= set GONOSUMDB= set GOOS=windows go: stripping unprintable or unescapable characters from %"GOPATH"% set GOPATH=C:\Users\������\Desktop\Go set GOPRIVATE= set GOPROXY=direct set GOROOT=C:\Program Files\Go set GOSUMDB=off set GOTELEMETRY=local go: stripping unprintable or unescapable characters from %"GOTELEMETRYDIR"% set GOTELEMETRYDIR=C:\Users\������\AppData\Roaming\go\telemetry set GOTMPDIR= set GOTOOLCHAIN=auto set GOTOOLDIR=C:\Program Files\Go\pkg\tool\windows_amd64 set GOVCS= set GOVERSION=go1.24.0 set GOWORK= set PKG_CONFIG=pkg-config code page 437PS C:\Users\陈杰> chcp Active code page: 437 PS C:\Users\陈杰> go env set AR=ar set CC=gcc set CGO_CFLAGS=-O2 -g set CGO_CPPFLAGS= set CGO_CXXFLAGS=-O2 -g set CGO_ENABLED=1 set CGO_FFLAGS=-O2 -g set CGO_LDFLAGS=-O2 -g set CXX=g++ set GCCGO=gccgo set GO111MODULE= set GOAMD64=v1 set GOARCH=amd64 set GOAUTH=netrc go: stripping unprintable or unescapable characters from %"GOBIN"% set GOBIN=C:\Users\������\Desktop\Go\bin go: stripping unprintable or unescapable characters from %"GOCACHE"% set GOCACHE=C:\Users\������\Desktop\Go\cache set GOCACHEPROG= set GODEBUG= go: stripping unprintable or unescapable characters from %"GOENV"% set GOENV=C:\Users\������\AppData\Roaming\go\env set GOEXE=.exe set GOEXPERIMENT= set GOFIPS140=off set GOFLAGS= go: stripping unprintable or unescapable characters from %"GOGCCFLAGS"% set GOGCCFLAGS=-m64 -mthreads -Wl,--no-gc-sections -fmessage-length=0 -ffile-prefix-map=C:\Users\������\AppData\Local\Temp\go-build3667658653=/tmp/go-build -gno-record-gcc-switches set GOHOSTARCH=amd64 set GOHOSTOS=windows set GOINSECURE= set GOMOD=NUL go: stripping unprintable or unescapable characters from %"GOMODCACHE"% set GOMODCACHE=C:\Users\������\Desktop\Go\pkg\mod set GONOPROXY= set GONOSUMDB= set GOOS=windows go: stripping unprintable or unescapable characters from %"GOPATH"% set GOPATH=C:\Users\������\Desktop\Go set GOPRIVATE= set GOPROXY=direct set GOROOT=C:\Program Files\Go set GOSUMDB=off set GOTELEMETRY=local go: stripping unprintable or unescapable characters from %"GOTELEMETRYDIR"% set GOTELEMETRYDIR=C:\Users\������\AppData\Roaming\go\telemetry set GOTMPDIR= set GOTOOLCHAIN=auto set GOTOOLDIR=C:\Program Files\Go\pkg\tool\windows_amd64 set GOVCS= set GOVERSION=go1.24.0 set GOWORK= set PKG_CONFIG=pkg-config |
Does the patch in https://go.dev/cl/651295 fix the problem? |
Change https://go.dev/cl/651295 mentions this issue: |
In #71857, the
go env
output shows several warnings likeLater in the issue there is a screenshot of Powershell which seems capable of printing the characters just fine.
@chenjie199234 could you post the exact characters in your
C:\Users\...
path so we can see if there is an issue with the way cmd/go is handling these Unicode characters?The text was updated successfully, but these errors were encountered: