roc icon indicating copy to clipboard operation
roc copied to clipboard

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

Open lukewilliamboswell opened this issue 1 year ago • 1 comments

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

lukewilliamboswell avatar Jul 28 '24 00:07 lukewilliamboswell

Hey, I'm interested in working on this.

hrishisd avatar Oct 10 '24 16:10 hrishisd

Related (also about invisible unicode characters): https://github.com/roc-lang/roc/issues/6929 https://github.com/roc-lang/roc/issues/6927

skyqrose avatar Nov 23 '24 23:11 skyqrose

It's possible that parts of https://github.com/roc-lang/roc/pull/7730 could be used here as well.

Anton-4 avatar Apr 22 '25 09:04 Anton-4