From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1JLHQm-0004fA-KV for mharc-grub-devel@gnu.org; Sat, 02 Feb 2008 07:25:12 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JLHQk-0004ex-Vo for grub-devel@gnu.org; Sat, 02 Feb 2008 07:25:11 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JLHQk-0004el-IQ for grub-devel@gnu.org; Sat, 02 Feb 2008 07:25:10 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JLHQk-0004ei-Dp for grub-devel@gnu.org; Sat, 02 Feb 2008 07:25:10 -0500 Received: from ns39764.ovh.net ([91.121.25.85] helo=nexedi.com) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1JLHQk-0003gQ-9W for grub-devel@gnu.org; Sat, 02 Feb 2008 07:25:10 -0500 Received: from [10.8.0.46] (unknown [10.8.0.46]) by nexedi.com (Postfix) with ESMTP id 172FE3EB26 for ; Sat, 2 Feb 2008 13:31:52 +0100 (CET) From: "Yoshinori K. Okuji" Organization: enbug.org To: The development of GRUB 2 Date: Sat, 2 Feb 2008 13:25:07 +0100 User-Agent: KMail/1.9.4 References: <94a0ccbc0802011319v21f1904aj628bebc48a614bf6@mail.gmail.com> In-Reply-To: <94a0ccbc0802011319v21f1904aj628bebc48a614bf6@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200802021325.07324.okuji@enbug.org> X-detected-kernel: by monty-python.gnu.org: Linux 2.6 (newer, 3) Subject: Re: grub_cmdline_get() i18n problem X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: The development of GRUB 2 List-Id: The development of GRUB 2 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 02 Feb 2008 12:25:11 -0000 On Friday 01 February 2008 22:19, Oleg Strikov wrote: > Good day! > > Let's look at grub_cmdline_get() func code: > > /* normal/cmdline.c - line 300 */ > plen = grub_utf8_strlen (prompt); > lpos = llen = 0; > buf[0] = '\0'; > > if ((grub_getxy () >> 8) != 0) > grub_putchar ('\n'); > > grub_printf (prompt); > > xpos = plen; > > Idea is very simple - we move cursor `plen` times. > All is OK when `promt` contains only ASCII symblos. If we use UTF8 strings > - we get incorrect cursor moving (grub_strlen returns incorrect length due > to UTF-8 symbol floating byte size). > There are two ways: > * encode smth like grub_utf8_strlen () > * modify grub_strlen () func and add this feature > > I do my best to solve this problem, but what way do you recommend? PROMPT is always in ASCII. This was my assumption. Is it bad? Okuji