From d6b3625be21223fd05d103fc132f753747965c6d Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Fri, 12 Nov 2021 14:22:21 +0100 Subject: util.human.io: Use UTF-8-aware length check in padding functions --- util/human/io.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'util') diff --git a/util/human/io.lua b/util/human/io.lua index 83a521c3..7d7dea97 100644 --- a/util/human/io.lua +++ b/util/human/io.lua @@ -93,11 +93,11 @@ local function printf(fmt, ...) end local function padright(s, width) - return s..string.rep(" ", width-#s); + return s..string.rep(" ", width-len(s)); end local function padleft(s, width) - return string.rep(" ", width-#s)..s; + return string.rep(" ", width-len(s))..s; end local pat = "[%z\001-\127\194-\253][\128-\191]*"; -- cgit v1.2.3