You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Originally posted by nedtwigg December 11, 2022
I think it's important for plaintext snapshots to have perfect roundtrips. That means that it's okay if the encoded text isn't exactly the same as the original text, but when decoded it should be exactly the same again, including newlines. I can see a good argument for removing all \r from snapshots though...
Dumb example: if you change every character into open paren unicode number hex close parent so that A becomes (41), that encoding is bad, but lossless. You get back exactly what you put in.
By picking rare characters for the brackets and escape characters, you get an encoding which is almost always just the text on its own, but in the rare case that you need to escape some characters to encode, you can still perfectly decode.
I dumped some example code which does encoding of that type into #126, feel free to use it if you'd like.
The text was updated successfully, but these errors were encountered:
Discussed in #129
Originally posted by nedtwigg December 11, 2022
I think it's important for plaintext snapshots to have perfect roundtrips. That means that it's okay if the encoded text isn't exactly the same as the original text, but when decoded it should be exactly the same again, including newlines. I can see a good argument for removing all
\r
from snapshots though...Dumb example: if you change every character into open paren unicode number hex close parent so that
A
becomes(41)
, that encoding is bad, but lossless. You get back exactly what you put in.By picking rare characters for the brackets and escape characters, you get an encoding which is almost always just the text on its own, but in the rare case that you need to escape some characters to encode, you can still perfectly decode.
I dumped some example code which does encoding of that type into #126, feel free to use it if you'd like.
The text was updated successfully, but these errors were encountered: