core icon indicating copy to clipboard operation
core copied to clipboard

Have toString show escape code for \u{0001}

Open rhofour opened this issue 8 years ago • 1 comments

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 https://github.com/elm-community/elm-test/issues/225 .

rhofour avatar Dec 24 '17 14:12 rhofour

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 avatar Dec 24 '17 14:12 process-bot