From 14c02530b50180ecde97d826b4d7f6b4d9c1b0ed Mon Sep 17 00:00:00 2001 From: Alex Duan <417921451@qq.com> Date: Thu, 20 Oct 2022 18:46:39 +0800 Subject: [PATCH] fix(shell): fixed chinese input error 1 --- tools/shell/src/shellCommand.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/tools/shell/src/shellCommand.c b/tools/shell/src/shellCommand.c index 29aea21d54..a0ac8e07c7 100644 --- a/tools/shell/src/shellCommand.c +++ b/tools/shell/src/shellCommand.c @@ -102,11 +102,9 @@ void shellInsertChar(SShellCmd *cmd, char *c, int32_t size) { /* update the values */ cmd->commandSize += size; cmd->cursorOffset += size; - for (int i = 0; i < size; i++) { - taosMbToWchar(&wc, c + i, size); - cmd->screenOffset += taosWcharWidth(wc); - cmd->endOffset += taosWcharWidth(wc); - } + cmd->screenOffset += taosWcharWidth(wc); + cmd->endOffset += taosWcharWidth(wc); + // set string end cmd->command[cmd->commandSize] = 0; #ifdef WINDOWS