Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
lukewilliamboswell opened this issue Jul 28, 2024 · 3 comments · Fixed by #7763
Closed

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

lukewilliamboswell opened this issue Jul 28, 2024 · 3 comments · Fixed by #7763
Assignees
Labels
enhancement New feature or request error-messages Related to the quality of error messages good first issue Good for newcomers

Comments

@lukewilliamboswell
Copy link
Collaborator

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 lukewilliamboswell added enhancement New feature or request good first issue Good for newcomers error-messages Related to the quality of error messages labels Jul 28, 2024
@hrishisd
Copy link
Contributor

Hey, I'm interested in working on this.

@skyqrose
Copy link
Collaborator

Related (also about invisible unicode characters): #6929 #6927

@Anton-4
Copy link
Collaborator

Anton-4 commented Apr 22, 2025

It's possible that parts of #7730 could be used here as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request error-messages Related to the quality of error messages good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants