grub-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: grub_cmdline_get() i18n problem


From: Yoshinori K. Okuji
Subject: Re: grub_cmdline_get() i18n problem
Date: Sat, 2 Feb 2008 13:25:07 +0100
User-agent: KMail/1.9.4

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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]