From 6a540fdbb3f5f25ad49de47a5ad22d8cc178c42a Mon Sep 17 00:00:00 2001 From: albertexye Date: Mon, 1 Apr 2024 13:40:09 -0400 Subject: [PATCH] count characters using u8_length instead of size --- src/pocketpy.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pocketpy.cpp b/src/pocketpy.cpp index 877a5e5a..27455846 100644 --- a/src/pocketpy.cpp +++ b/src/pocketpy.cpp @@ -734,7 +734,7 @@ void init_builtins(VM* _vm) { int delta = width - self.u8_length(); if(delta <= 0) return args[0]; const Str& fillchar = CAST(Str&, args[2]); - if (fillchar.size != 1) vm->TypeError("The fill character must be exactly one character long"); + if (fillchar.u8_length() != 1) vm->TypeError("The fill character must be exactly one character long"); SStream ss; ss << self; for(int i=0; iTypeError("The fill character must be exactly one character long"); + if (fillchar.u8_length() != 1) vm->TypeError("The fill character must be exactly one character long"); SStream ss; for(int i=0; i