Homec4science

Make Differential linewrap utf-8 aware

Authored by epriestley <git@epriestley.com> on Jun 24 2011, 18:25.

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

Committed
epriestley <git@epriestley.com>Jun 26 2011, 20:58
Pushed
aubortJan 31 2017, 17:16
Parents
rPH1b55c4bdc9b7: Make "Countdown" aware of time locales
Branches
Unknown
Tags
Unknown

Event Timeline

epriestley <git@epriestley.com> committed rPH5cfc14cb43c5: Make Differential linewrap utf-8 aware (authored by epriestley <git@epriestley.com>).Jun 26 2011, 20:58