Fix Unicode parsing issues with diff fragment and entry update payloads.
Review Request #9450 — Created Dec. 18, 2017 and submitted
Review Board 3.0 introduced a more efficient way of transferring diff
fragments for comments, and a mechanism for providing updates to entries
on the review request page. These used a streamable format that encoded
byte lengths followed by content.
they deal with them as Unicode data. This meant that our byte counts
would be wildly off whenever any multi-byte characters were introduced
in any of the content sections, causing various breakages.
A long-term (and in-progress) solution is to switch to interpreting
DataViewobjects, which would allow any form of content to be made
available in the payload. For now, though, since these are all UTF-8
string content, we can resolve this issue by storing character counts
and not byte counts.
Manually tested Unicode content in updates and diff fragments. They
Removed some unnecessary variables.
Revision 2 (+263 -13)
Checks run (2 succeeded)