From: Robert Millan <rmh@aybabtu.com>
To: The development of GRUB 2 <grub-devel@gnu.org>
Subject: Re: [PATCH] UTF-8 to UTF-16 transformation
Date: Fri, 28 Aug 2009 18:21:17 +0200 [thread overview]
Message-ID: <20090828162117.GA14976@thorin> (raw)
In-Reply-To: <d7ead6de0908271431q55bf5b7bna79d15a37fb481a2@mail.gmail.com>
On Thu, Aug 27, 2009 at 11:31:28PM +0200, Vladimir 'phcoder' Serbinenko wrote:
> On Wed, Aug 26, 2009 at 2:31 AM, Robert Millan<rmh@aybabtu.com> wrote:
> > On Mon, Aug 24, 2009 at 09:23:22PM +0200, Vladimir 'phcoder' Serbinenko wrote:
> >
> >> 2009-08-24 Vladimir Serbinenko <phcoder@gmail.com>
> >>
> >> UTF-8 to UTF-16 transformation.
> >>
> >> * conf/common.rmk (pkglib_MODULES): Add utf.mod
> >> (utf_mod_SOURCES): New variable.
> >> (utf_mod_CFLAGS): Likewise.
> >> (utf_mod_LDFLAGS): Likewise.
> >> * include/grub/utf.h: New file.
> >> * lib/utf.c: New file. (Based on grub_utf8_to_ucs4 from kern/misc.c)
> >
> > Sounds like we could end up needing more of this (to other charsets), so
> > why not give this module a generic name to hint as to where it can be added?
> >
> I'm ok with renaming but whether a conversion goes to charset.mod is
> perhaps to be decided on case-by-case basis-
> > The conversion functions in kern/misc.c could eventually move there as well,
> > once UTF-8 support becomes optional in the kernel.
> utf16_to_utf8 can be moved now out of the kernel but it's used by some
> fs modules (e.g. fat). Perhaps utf16_to_utf8 should be a separate
> module? This would decrease the size of biggest cores with the price
> of its increase in smaller cores.
Uhm perhaps we should use inline functions then. What do you think?
> >> + if ((c & 0x80) == 0x00)
> >> + code = c;
> >> + else if ((c & 0xe0) == 0xc0)
> >
> > These should be macroified.
> >
> Actually this are accelerated bitchecks (bit numbers follow specific
> and easy pattern) and for real readability would have to be written in
> binary but AFAIK binary notation isn't supported in C code and would
> result in overly long strings
Ah, right. Then it's not a problem. Maybe with (1 << 7) instead of 0x80,
if you prefer.
--
Robert Millan
The DRM opt-in fallacy: "Your data belongs to us. We will decide when (and
how) you may access your data; but nobody's threatening your freedom: we
still allow you to remove your data and not access it at all."
next prev parent reply other threads:[~2009-08-28 16:21 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-08-24 19:22 [PATCH] UTF-8 to UTF-16 transformation Vladimir 'phcoder' Serbinenko
2009-08-24 19:23 ` Vladimir 'phcoder' Serbinenko
2009-08-26 0:31 ` Robert Millan
2009-08-26 23:27 ` Joe Auricchio
2009-08-27 21:31 ` Vladimir 'phcoder' Serbinenko
2009-08-27 22:11 ` Installing Solaris without a CDROM Seth Goldberg
2009-08-28 13:21 ` [PATCH] UTF-8 to UTF-16 transformation Vladimir 'phcoder' Serbinenko
2009-08-28 16:21 ` Robert Millan [this message]
2009-08-28 17:39 ` Vladimir 'phcoder' Serbinenko
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=20090828162117.GA14976@thorin \
--to=rmh@aybabtu.com \
--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.