git/builtin
Nguyễn Thái Ngọc Duy 1452bd64f1 branch -v: align even when branch names are in UTF-8
Branch names are usually in ASCII so they are not the problem. The
problem most likely comes from "(no branch)" translation, which is
in UTF-8 and makes display-width calculation just wrong.  Clarify
this by renaming the field "len" in struct ref_item to "width", as
it stores the display-width and is used to compute the width of the
screen needed to show the names of all the branches, and compute the
display width using utf8_strwidth(), not byte-length with strlen().

Update document to mention the fact that we may want ref names in
UTF-8. Encodings that produce invalid UTF-8 are safe as utf8_strwidth()
falls back to strlen(). The ones that incidentally produce valid UTF-8
sequences will cause misalignment.

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-08-27 11:42:28 -07:00
..
2012-03-28 15:19:17 -07:00
2012-06-15 14:27:35 -07:00
2012-04-18 16:17:42 -07:00
2012-05-03 15:13:31 -07:00
2011-03-22 10:16:54 -07:00
2011-03-22 10:16:54 -07:00
2011-12-28 11:32:36 -08:00
2011-12-22 11:27:26 -08:00
2011-03-22 10:16:54 -07:00
2011-03-22 10:16:54 -07:00
2011-03-22 11:43:27 -07:00
2011-03-22 10:16:54 -07:00
2012-05-20 18:48:10 -07:00
2011-03-09 23:52:56 -08:00
2011-05-31 12:19:11 -07:00
2011-03-22 10:16:54 -07:00
2011-08-25 14:42:11 -07:00