From 69c5fef3ae6bd6d61b86b57470cdb2c4ed4dbe42 Mon Sep 17 00:00:00 2001 From: miteruzo Date: Sun, 3 Dec 2023 14:32:48 +0900 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- common_module.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/common_module.py b/common_module.py index e50bff3..e0f8966 100644 --- a/common_module.py +++ b/common_module.py @@ -8,14 +8,13 @@ class CommonModule: @classmethod def len_by_full (cls, string: str) -> float: - return sum ([1 if cls.is_wide (c) else .5 - for c in string.decode ('utf-8')]) + return sum ([1 if cls.is_wide (c) else .5 for c in string]) @classmethod def index_by_f2c (cls, string: str, index: float) -> int: i = 0 work = '' - for c in string.decode ('utf-8'): + for c in string: work += c if cls.len_by_full (work) > index: break