Skip to content

Commit fd9af97

Browse files
tools/sizes.py: Change Unicode box-drawing chars to that of double version (#8573)
Due to historical circumstances, some of light/heavy version of Unicode box-drawing chars may have twice width of others (aka. "Zen-Kaku" in Japanese, means full-square), eg. All of '─'(U+2500), '│'(U+2502), '└'(U+2514) and '├'(U+251C) correspond to that in Windows Japanese fonts and locale. Double versions, '═'(U+2550), '║'(U+2551), '╚'(U+255A) and '╠'(U+2560) are not like that. (See [Box Drawing, The Unicode Standard](https://www.unicode.org/charts/PDF/U2500.pdf))
1 parent fbba25c commit fd9af97

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

tools/sizes.py

+6-3
Original file line numberDiff line numberDiff line change
@@ -110,9 +110,9 @@ def safe_prefix(n, length):
110110

111111
def prefix(n, length):
112112
if n == length:
113-
return "└──"
113+
return "╚══"
114114

115-
return "├──"
115+
return "╠══"
116116

117117

118118
def filter_segments(segments):
@@ -159,7 +159,10 @@ def main():
159159
number, used, segments = filter_segments(segments)
160160

161161
print(f". {group:<8}, used {used} / {total} bytes ({percentage(used, total)})")
162-
print("| SEGMENT BYTES DESCRIPTION")
162+
try:
163+
print("║ SEGMENT BYTES DESCRIPTION")
164+
except UnicodeEncodeError:
165+
print("| SEGMENT BYTES DESCRIPTION")
163166
for n, segment, size in segments:
164167
try:
165168
print(f"{prefix(n, number)} ", end="")

0 commit comments

Comments
 (0)