HomePhorge

Make Differential linewrap utf-8 aware

Description

Make Differential linewrap utf-8 aware

Summary:
Differential uses a byte-oriented linewrap algorithm. Instead, use a
character-oriented one which will handle utf-8 properly.

This implies a very slightly performance hit but we only run this code for lines
which need to wrap, and the results get cached. It took about ~2.5ms for the
test file on my machine. I'll keep an eye on it but I think it's currently a
manageable cost.

Test Plan:
Diffed this file: https://secure.phabricator.com/P43
...and got it to render like this:
https://secure.phabricator.com/file/info/PHID-FILE-331ac241bede705b193b/

To do so, I had to disable the un-utf8 block which we can't actually do yet
because of intraline diff, but it shows that once we can get rid of that it
works completely correctly. It will "sort of" work in the meantime (nothing
terrible happens).

Reviewers: jungejason, aran, tuomaspelkonen
CC: aran, epriestley
Differential Revision: 513

Details

Provenance
epriestleyAuthored on Jun 24 2011, 9:25 AM
themackabuPushed on Mar 25 2025, 8:07 PM
Parents
rP1b55c4bdc9b7: Make "Countdown" aware of time locales
Branches
Unknown
Tags
Unknown

Event Timeline