Skip to content

Unable to use some Hindi unicode characters in source code as identifiers #42830

Closed
@harshrathod50

Description

@harshrathod50

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

$ go version
go version go1.15.2 windows/amd64

Does this issue reproduce with the latest release?

I don't know.

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

go env Output
$ go env
set GO111MODULE=
set GOARCH=amd64
set GOBIN=
set GOCACHE=C:\Users\Harsh Rathod\AppData\Local\go-build
set GOENV=C:\Users\Harsh Rathod\AppData\Roaming\go\env
set GOEXE=.exe
set GOFLAGS=
set GOHOSTARCH=amd64
set GOHOSTOS=windows
set GOINSECURE=
set GOMODCACHE=C:\Users\Harsh Rathod\go\pkg\mod
set GONOPROXY=
set GONOSUMDB=
set GOOS=windows
set GOPATH=C:\Users\Harsh Rathod\go
set GOPRIVATE=
set GOPROXY=https://proxy.golang.org,direct
set GOROOT=c:\go
set GOSUMDB=sum.golang.org
set GOTMPDIR=
set GOTOOLDIR=c:\go\pkg\tool\windows_amd64
set GCCGO=gccgo
set AR=ar
set CC=gcc
set CXX=g++
set CGO_ENABLED=1
set GOMOD=
set CGO_CFLAGS=-g -O2
set CGO_CPPFLAGS=
set CGO_CXXFLAGS=-g -O2
set CGO_FFLAGS=-g -O2
set CGO_LDFLAGS=-g -O2
set PKG_CONFIG=pkg-config
set GOGCCFLAGS=-m64 -mthreads -fmessage-length=0 -fdebug-prefix-map=C:\Users\HARSHR~1\AppData\Local\Temp\go-build432409930=/tmp/go-build -gno-record-gcc-switches

What did you do?

As per the spec, I should be able to use Unicode characters in source code but unable to do so as seen here.

What did you expect to see?

I expected the program to compile as usual. But when I remove some specific Hindi characters from the identifier: पोर्ट_नंबर to परट_नबर, the code compiles to give output:

Port: 5432

What did you see instead?

./prog.go:6:5: invalid character U+094B 'ो' in identifier
./prog.go:6:11: invalid character U+094D '्' in identifier
./prog.go:6:21: invalid character U+0902 'ं' in identifier
./prog.go:7:26: invalid character U+094B 'ो' in identifier
./prog.go:7:32: invalid character U+094D '्' in identifier
./prog.go:7:42: invalid character U+0902 'ं' in identifier

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions