Strip BOM from the event data, add an encoding configuration option on the writer for writing the BOM#458
Closed
dralley wants to merge 3 commits intotafia:masterfrom
Closed
Strip BOM from the event data, add an encoding configuration option on the writer for writing the BOM#458dralley wants to merge 3 commits intotafia:masterfrom
dralley wants to merge 3 commits intotafia:masterfrom
Conversation
485088d to
1168dd4
Compare
Collaborator
Author
|
Somewhat depends on your feelings about #441 (comment) |
dralley
commented
Aug 16, 2022
|
|
||
| /// Creates a Writer from a generic Write implementor with configured whitespace indents and a | ||
| /// specified encoding scheme. | ||
| pub fn new_with_indent_and_encoding( |
Collaborator
Author
There was a problem hiding this comment.
This feels like it's right up at the line of perhaps justifying a builder.
Only Utf8 and Utf8WithBom are supported, as encoding_rs doesn't and likely won't support other encodings.
StartText would be out of place once all events are expected to contain UTF-8. Additionally the decoder implementation strips BOM bytes out of the bytestream so there's no good way to access them.
1168dd4 to
2221871
Compare
2221871 to
60e334f
Compare
Collaborator
Author
|
Rethinking the approach slightly. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
We need to allow users to write a BOM, but encoding it in the event stream creates other issues. Instead lets delegate it to an option on the
Writer.