All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Yoshinori K. Okuji" <okuji@enbug.org>
To: The development of GRUB 2 <grub-devel@gnu.org>
Subject: Re: grub_cmdline_get() i18n problem
Date: Sat, 2 Feb 2008 13:25:07 +0100	[thread overview]
Message-ID: <200802021325.07324.okuji@enbug.org> (raw)
In-Reply-To: <94a0ccbc0802011319v21f1904aj628bebc48a614bf6@mail.gmail.com>

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



  parent reply	other threads:[~2008-02-02 12:25 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-01 21:19 grub_cmdline_get() i18n problem Oleg Strikov
2008-02-01 21:48 ` Robert Millan
2008-02-02 12:25 ` Yoshinori K. Okuji [this message]
  -- strict thread matches above, loose matches on Subject: below --
2008-02-03 13:00 Oleg Strikov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200802021325.07324.okuji@enbug.org \
    --to=okuji@enbug.org \
    --cc=grub-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.