Counts UTF-8 code units for the purpose of string width instead of code points.
What steps will reproduce the problem?
(1) Add a line to a file.
(2) git commit --author="超 Blame 💩"
(3) git hyper-blame <file>, and find the added line.
What is the expected result?
All rows in the table align.
What happens instead?
The line with Unicode characters in the author is shorter than the others.
1bb81a08 (Matt Giuca 2018-01-29 14:59:16 +1100 1735) given by the following algorithm. The algorithm takes a
981f9268 (超 Blame 💩 2018-02-05 14:26:43 +1100 1736) whatever
1bb81a08 (Matt Giuca 2018-01-29 14:59:16 +1100 1737) <a>USVString</a> <var>value</var>, a <a>URL</a> <var>manifest
Python 2's shitty Unicode support strikes again. Can we upgrade to Python 3 one day?
This is because git hyper-blame uses len(str) counting the bytes of the string, not the characters.
We could use *graphemes* but in my experience, a terminal won't display graphemes in a single-character box anyway, so the simplest thing is just to count code points.
Comment 1 by bugdroid1@chromium.org
, Feb 12 2018