Unicode support in package names?

256 views
Skip to first unread message

andrew.p...@gmail.com

unread,
Jan 11, 2017, 6:39:40 PM1/11/17
to golang-dev
Go has decent support for Unicode, but go get doesn't appear to include this yet:

$ go get -u github.com/mcandre/toys/go/испытание
package github.com/mcandre/toys/go/испытание: invalid github.com/ import path "github.com/mcandre/toys/go/испытание"

Brad Fitzpatrick

unread,
Jan 11, 2017, 6:43:43 PM1/11/17
to andrew.p...@gmail.com, golang-dev
Please file a bug.

That should work. The problem appears to be in vcs.go:

var vcsPaths = []*vcsPath{
        // Github                                                                                                                               
        {
                prefix: "github.com/",
                re:     `^(?P<root>github\.com/[A-Za-z0-9_.\-]+/[A-Za-z0-9_.\-]+)(/[A-Za-z0-9_.\-]+)*$`,
                vcs:    "git",
                repo:   "https://{root}",
                check:  noVCSSuffix,
        },



--
You received this message because you are subscribed to the Google Groups "golang-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-dev+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

minux

unread,
Jan 11, 2017, 6:46:17 PM1/11/17
to andrew.p...@gmail.com, golang-dev
Please file an issue. The underlying issue is the github import path
regular expression hardcodes the allowed characters.

^(?P<root>github\.com/[A-Za-z0-9_.\-]+/[A-Za-z0-9_.\-]+)(/[A-Za-z0-9_.\-]+)*$ 

Perhaps it doesn't need to care beyond the user and repository name?

Russ Cox

unread,
Jan 12, 2017, 8:52:25 AM1/12/17
to minux, andrew.p...@gmail.com, golang-dev
Yes, please file an issue, but I think this was intentional. Import paths get written to the file system, and we want to make sure that Go code can be checked out almost everywhere, even on file systems that aren't as good at Unicode as yours.

Russ

Reply all
Reply to author
Forward
0 new messages