summaryrefslogtreecommitdiff
path: root/contrib/mw-to-git/t/install-wiki
diff options
context:
space:
mode:
authorLibravatar Nguyễn Thái Ngọc Duy <pclouds@gmail.com>2012-08-26 01:17:12 +0700
committerLibravatar Junio C Hamano <gitster@pobox.com>2012-08-27 11:42:28 -0700
commit1452bd64f14efd888fe9c732f603173ba7fa595e (patch)
tree4d9e48433340d151ee32802fdd52ab634adf9b87 /contrib/mw-to-git/t/install-wiki
parentPrepare for 1.7.11.6 (diff)
downloadtgif-1452bd64f14efd888fe9c732f603173ba7fa595e.tar.xz
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>
Diffstat (limited to 'contrib/mw-to-git/t/install-wiki')
0 files changed, 0 insertions, 0 deletions