Go version
go version go1.21.4 linux/amd64
Output of go env in your module/workspace:
GO111MODULE=''
GOARCH='amd64'
GOBIN=''
GOCACHE='/home/ubuntu/.cache/go-build'
GOENV='/home/ubuntu/.config/go/env'
GOEXE=''
GOEXPERIMENT=''
GOFLAGS=''
GOHOSTARCH='amd64'
GOHOSTOS='linux'
GOINSECURE=''
GOMODCACHE='/home/ubuntu/go/pkg/mod'
GONOPROXY=''
GONOSUMDB=''
GOOS='linux'
GOPATH='/home/ubuntu/go'
GOPRIVATE=''
GOPROXY='https://proxy.golang.org,direct'
GOROOT='/opt/gol.21.4'
GOSUMDB='sum.golang.org'
GOTMPDIR=''
GOTOOLCHAIN='auto'
GOTOOLDIR='/opt/gol.21.4/pkg/tool/linux_amd64'
GOVCS=''
GOVERSION='go1.21.4'
GCCGO='gccgo'
GOAMD64='v1'
AR='ar'
CC='gcc'
CXX='g++'
CGO_ENABLED='1'
GOMOD='/dev/null'
GOWORK=''
CGO_CFLAGS='-O2 -g'
CGO_CPPFLAGS=''
CGO_CXXFLAGS='-O2 -g'
CGO_FFLAGS='-O2 -g'
CGO_LDFLAGS='-O2 -g'
PKG_CONFIG='pkg-config'
GOGCCFLAGS='-fPIC -m64 -pthread -Wl,--no-gc-sections -fmessage-length=0 -ffile-prefix-map=/tmp/go-build4093406638=/tmp/go-build -gno-record-gcc-switches'
What did you do?
the html.UnescapeString() function does not decode one character number correctly.
package main
import (
"fmt"
"html"
)
func main() {
fmt.Println(html.UnescapeString("(	)"))
}
https://go.dev/play/p/kCEC5INrCNt
What did you see happen?
output:
I think the "No characters matched." check logic of function html.unescapeEntity() is incorrect.
https://cs.opensource.google/go/go/+/refs/tags/go1.22.0:src/html/escape.go;l=107
What did you expect to see?
want:
Edge/Chrome/Firefox displays the following html as ( ).
https://jsfiddle.net/Lkm6jy3c/
Go version
go version go1.21.4 linux/amd64
Output of
go envin your module/workspace:What did you do?
the html.UnescapeString() function does not decode one character number correctly.
https://go.dev/play/p/kCEC5INrCNt
What did you see happen?
output:
I think the "No characters matched." check logic of function html.unescapeEntity() is incorrect.
https://cs.opensource.google/go/go/+/refs/tags/go1.22.0:src/html/escape.go;l=107
What did you expect to see?
want:
Edge/Chrome/Firefox displays the following html as ( ).
https://jsfiddle.net/Lkm6jy3c/