Skip to content

Controlled encoding switch#315

Merged
orium merged 4 commits into
mainfrom
encoding_switch
Apr 28, 2026
Merged

Controlled encoding switch#315
orium merged 4 commits into
mainfrom
encoding_switch

Conversation

@kornelski

@kornelski kornelski commented Apr 27, 2026

Copy link
Copy Markdown
Contributor

Rewriter can now inform OutputSink what encoding is being used. Without that, the OutputSink had no way of correctly handling varying character encodings other than reparsing HTML itself.

Directly using interior-mutable SharedEncoding made it harder to reason about currently used encoding. With encoding change being an explicit step, a simpler AsciiCompatibleEncoding can be used in more places.

I've also replaced ALL_ENCODINGS lookup table with OnceLock. The encoding can be changed only once, so we can store AsciiCompatibleEncoding directly without going through AtomicUsize.

@kornelski kornelski requested review from a team, Noah-Kennedy, jasnell and orium as code owners April 27, 2026 19:54
@orium orium merged commit 8ba4da2 into main Apr 28, 2026
6 checks passed
@orium orium deleted the encoding_switch branch April 28, 2026 10:51
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

Successfully merging this pull request may close these issues.

2 participants