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:

Differential Revision: 513

Details

Committed
epriestley <git@epriestley.com>Jun 24 2011, 18:41
Pushed
aubortJan 31 2017, 17:16
Parents
rPHa632b220a84f: Index users in search results.
Branches
Unknown
Tags
Unknown
Reverted By
rPHb664d67a2242: Revert "Make Differential linewrap utf-8 aware"

Event Timeline

epriestley <git@epriestley.com> committed rPHe5a036e8c948: Make Differential linewrap utf-8 aware (authored by epriestley <git@epriestley.com>).Jun 24 2011, 18:41