# HG changeset patch # User Kim Alvefur # Date 1636723341 -3600 # Node ID e84ea5b58b2927202d6b627354ae11580ffc5e85 # Parent 93e9f7ae2f9bd1201d4f97c28e87d65a01f04c0a util.human.io: Use UTF-8-aware length check in padding functions diff -r 93e9f7ae2f9b -r e84ea5b58b29 util/human/io.lua --- a/util/human/io.lua Fri Nov 12 14:21:15 2021 +0100 +++ b/util/human/io.lua Fri Nov 12 14:22:21 2021 +0100 @@ -93,11 +93,11 @@ 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]*";