Skip to content
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

"format" should escape more control characters #3673

Open
d-torrance opened this issue Feb 24, 2025 · 0 comments
Open

"format" should escape more control characters #3673

d-torrance opened this issue Feb 24, 2025 · 0 comments

Comments

@d-torrance
Copy link
Member

d-torrance commented Feb 24, 2025

This still needs a bit more work:

i2 : toJSON "foo\0"

o2 = "foo\0"

i3 : fromJSON oo
stdio:3:8:(3): error: syntax error at token '0', position 5

toJSON "foo\0" should probably instead return "foo\u0000". I think maybe format should just do that for all the control characters except the ones that JSON supports like \n and \t. I'll take a look at some other common standards (Python strings, etc.) and try to make format output things that are as universal as possible.

Originally posted by @d-torrance in #3670 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant