-
Notifications
You must be signed in to change notification settings - Fork 6
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
Plaintext fields with control chars are not marshalled correctly in sparse structs #2
Comments
should be
|
I believe you are mistaken on two counts. Firstly |
I took another look and realized your issue was causes by the presence of a tab character Looking into what is going on. |
looks like this is a known issue with json-iterator: #json-iterator/go#698 Thinking that a brute force workaround might be the best idea. The other option would be to fork |
not going to investigate past this to fully confirm but suspect the bug in json-iterator is related to the behavior of the standard string encoder starts off here: // WriteString write string to stream without html escape
func (stream *Stream) WriteString(s string) { but then the function ends with: writeStringSlowPath(stream, i, s, valLen) which (unfortunately) is an escaping function. |
Chestnut cannot save a sparse struct with a plaintext field which contains the beginning and ending markers of a PGP public key block such as
"-----BEGIN PGP PUBLIC KEY BLOCK----- -----END PGP PUBLIC KEY BLOCK-----"
The field will be saved as blank.
I had wished for my public keys to be available to the .Sparse() function but the private key to require the full decryption of .Load()
The following test will reproduce the bug and will fail with "thingToSave did not match".
The text was updated successfully, but these errors were encountered: