From 21830d9886b3a9d84a870227330522dcc1f7b8dd Mon Sep 17 00:00:00 2001 From: SalavatR Date: Wed, 2 Feb 2022 19:51:15 +0600 Subject: [PATCH] Update input.lua MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit function set_allowed_characters(NAME_PATTERN) isn't working with Cyrillic symbols in range "[А-я]", string.match includes chars №, ₽ and may be more --- druid/extended/input.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/druid/extended/input.lua b/druid/extended/input.lua index 856b314..e1cc2fa 100755 --- a/druid/extended/input.lua +++ b/druid/extended/input.lua @@ -166,8 +166,8 @@ function Input.on_input(self, action_id, action) end) -- ignore arrow keys - if not string.match(hex, "EF9C8[0-3]") then - if not self.allowed_characters or action.text:match(self.allowed_characters) then + if not utf8.match(hex, "EF9C8[0-3]") then + if not self.allowed_characters or utf8.match(action.text, self.allowed_characters) then input_text = self.value .. action.text if self.max_length then input_text = utf8.sub(input_text, 1, self.max_length)