roc-lang / roc

A fast, friendly, functional language.
https://roc-lang.org
Universal Permissive License v1.0
4.46k stars 313 forks source link

Warn users if a `Str` literal contains invisible unicode characters #6928

Open lukewilliamboswell opened 3 months ago

lukewilliamboswell commented 3 months ago

Provide a warning if a Str literal contains invisible unicode characters

See zulip discussion for more context

example module

module []

# this string has invisible unicode in it... let's provide a warning to make this obvious
stringWithInivisbleUnicode = "FOO"

expect stringWithInivisbleUnicode == "FOO" # false

REPL

Using the real to show what the str contains.

» Str.toUtf8 "\u(feff)FOO"

[239, 187, 191, 70, 79, 79] : List U8
hrishisd commented 1 month ago

Hey, I'm interested in working on this.