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

Have toString show escape code for \u{0001} #930

Open
rhofour opened this Issue Dec 24, 2017 · 1 comment

Comments

Projects
None yet
3 participants
@rhofour

rhofour commented Dec 24, 2017

Consider the following string
x = "a\0b\1c"
If typed on the repl it will display like this:

"a\0bc" : String

It looks like we lost the \1 character, but actually it's being printed directly (and not showing up since it's an unprintable character). This can be verified as follows:
String.toList (toString x)

['a','\0','b','','c'] : List Char

This doesn't seem like a great way to handle this. I don't know what the best way to handle this is, but doing something simple like also escaping non-null unprintable characters seems like it'd be an improvement.

This is all on 0.18.0.

One suggestion for how to handle this better is at elm-community/elm-test#225 .

@process-bot

This comment has been minimized.

Show comment
Hide comment
@process-bot

process-bot Dec 24, 2017

Thanks for the issue! Make sure it satisfies this checklist. My human colleagues will appreciate it!

Here is what to expect next, and if anyone wants to comment, keep these things in mind.

process-bot commented Dec 24, 2017

Thanks for the issue! Make sure it satisfies this checklist. My human colleagues will appreciate it!

Here is what to expect next, and if anyone wants to comment, keep these things in mind.

@evancz evancz added the request label Mar 7, 2018

@evancz evancz changed the title from toString handles unprintable characters poorly to Have toString show escape code for \u{0001} Mar 7, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment