roc
roc copied to clipboard
Warn users if a `Str` literal contains invisible unicode characters
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
Hey, I'm interested in working on this.
Related (also about invisible unicode characters): https://github.com/roc-lang/roc/issues/6929 https://github.com/roc-lang/roc/issues/6927
It's possible that parts of https://github.com/roc-lang/roc/pull/7730 could be used here as well.