[Fizz Node] Fix null bytes written at text chunk boundaries (#26228)
We encode strings 2048 UTF-8 bytes at a time. If the string we are encoding crosses to the next chunk but the current chunk doesn't fit an integral number of characters, we need to make sure not to send the whole buffer, only the bytes that are actually meaningful. Fixes #24985. I was able to verify that this fixes the repro shared in the issue (be careful when testing because the null bytes do not show when printed to my terminal, at least). However, I don't see a clear way to add a test for this that will be resilient to small changes in how we encode the markup (since it depends on where specific multibyte characters fall against the 2048-byte boundaries).
S
Sophie Alpert committed
96cdeaf89bfde7551b4ffe4d685da169b780f2f7
Parent: ca2cf31
Committed by GitHub <noreply@github.com>
on 2/24/2023, 7:33:54 PM