<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/t/unit-tests/u-utf8-width.c, branch main</title>
<subtitle>Fork of git SCM with my patches.</subtitle>
<id>http://git.kilabit.info/git/atom?h=main</id>
<link rel='self' href='http://git.kilabit.info/git/atom?h=main'/>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/'/>
<updated>2025-11-17T00:04:24Z</updated>
<entry>
<title>builtin/repo: fix table alignment for UTF-8 characters</title>
<updated>2025-11-17T00:04:24Z</updated>
<author>
<name>Jiang Xin</name>
<email>worldhello.net@gmail.com</email>
</author>
<published>2025-11-15T13:36:11Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=7a03a10a3a746dd8565a3a0e6126f60523b41738'/>
<id>urn:sha1:7a03a10a3a746dd8565a3a0e6126f60523b41738</id>
<content type='text'>
The output table from "git repo structure" is misaligned when displaying
UTF-8 characters (e.g., non-ASCII glyphs). E.g.:

    | 仓库结构   | 值  |
    | -------------- | ---- |
    | * 引用       |      |
    |   * 计数     |   67 |

The previous implementation used simple width formatting with printf()
which didn't properly handle multi-byte UTF-8 characters, causing
misaligned table columns when displaying repository structure
information.

This change modifies the stats_table_print_structure function to use
strbuf_utf8_align() instead of basic printf width specifiers. This
ensures proper column alignment regardless of the character encoding of
the content being displayed.

Also add test cases for strbuf_utf8_align(), a function newly introduced
in "builtin/repo.c".

Signed-off-by: Jiang Xin &lt;worldhello.net@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>t/unit-tests: add UTF-8 width tests for CJK chars</title>
<updated>2025-11-17T00:04:24Z</updated>
<author>
<name>Jiang Xin</name>
<email>worldhello.net@gmail.com</email>
</author>
<published>2025-11-15T13:36:10Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=878fef8ebf6cf513842de14284ee58f4d92fcef3'/>
<id>urn:sha1:878fef8ebf6cf513842de14284ee58f4d92fcef3</id>
<content type='text'>
The file "builtin/repo.c" uses utf8_strwidth() to calculate the display
width of UTF-8 characters in a table, but the resulting output is still
misaligned. Add test cases for both utf8_strwidth and utf8_strnwidth to
verify that they correctly compute the display width for UTF-8
characters.

Also updated the build configuration in Makefile and meson.build to
include the new test suite in the build process.

Signed-off-by: Jiang Xin &lt;worldhello.net@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
</feed>
