Warning for look alike Unicode characters

258 views
Skip to first unread message

Delta

unread,
Jun 9, 2021, 5:30:04 PM6/9/21
to golan...@googlegroups.com

Tamás Gulácsi

unread,
Jun 10, 2021, 12:10:11 AM6/10/21
to golang-nuts
strings.EqualFold ?

Ian Lance Taylor

unread,
Jun 11, 2021, 5:00:32 PM6/11/21
to Delta, golang-nuts
Which context do you mean? You said "the Go tool." Do you mean
something in the tool, or do you mean something in the language?

For the tool, when does this come up?

For the language there is some relevant discussion in
https://golang.org/issue/20706.

Ian

Delta

unread,
Jun 11, 2021, 5:33:22 PM6/11/21
to Ian Lance Taylor, golang-nuts
Jun 12, 2021 3:00:01 AM Ian Lance Taylor <ia...@golang.org>:

> Which context do you mean?  You said "the Go tool."  Do you mean
> something in the tool, or do you mean something in the language?
>
> For the tool, when does this come up?

I don't know why I wrote this. I saw somewhere a post on rustc giving
help message in case error was produced due to use of look alike Unicode
characters like Greek question mark in place of ;

I thought that is cool.

I am sorry.

Ian Lance Taylor

unread,
Jun 11, 2021, 5:48:05 PM6/11/21
to Delta, golang-nuts
No need to apologize. It's an interesting idea. There is nothing
similar in Go today.

Ian

drc...@google.com

unread,
Jun 14, 2021, 10:15:16 AM6/14/21
to golang-nuts
I was going to ask, "how do they define/measure that?", decided to look at the Rust code, and found http://www.unicode.org/Public/security/10.0.0/confusables.txt
So there's a defined source and everything.

Bryan C. Mills

unread,
Jun 14, 2021, 11:15:17 AM6/14/21
to golang-nuts
See also:
https://golang.org/issue/20115 (proposal: cmd/vet: detect homograph attacks)
https://golang.org/issue/20209 (proposal: spec: disallow LTR/RTL characters in string literals?)
https://golang.org/issue/20210 (proposal: spec: disallow unicode import paths to avoid punycode attacks)

Reply all
Reply to author
Forward
0 new messages