Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1MgmZG-00028i-8y for mharc-grub-devel@gnu.org; Thu, 27 Aug 2009 17:31:38 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MgmZD-00027o-PA for grub-devel@gnu.org; Thu, 27 Aug 2009 17:31:35 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MgmZ9-00026e-7D for grub-devel@gnu.org; Thu, 27 Aug 2009 17:31:35 -0400 Received: from [199.232.76.173] (port=45063 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MgmZ8-00026T-Vm for grub-devel@gnu.org; Thu, 27 Aug 2009 17:31:31 -0400 Received: from mail-fx0-f226.google.com ([209.85.220.226]:49258) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MgmZ8-0004Ab-9J for grub-devel@gnu.org; Thu, 27 Aug 2009 17:31:30 -0400 Received: by fxm26 with SMTP id 26so1461862fxm.42 for ; Thu, 27 Aug 2009 14:31:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=wHtMoCw3EdkbMgXhy8oVNn7YyZgGm0zAEm/zODkLmYY=; b=h6L3UN+Eps4OA2BqJzAEe6WnoVdO53i7ZEVGi/Zs2vSiYfNUUcHR+aKHmoi7LReYIC MCpRcnhApxHk8csgTII+esXG2YcYrqMrHpITWSMk0JRwcts0AjHFPOZ0CY6jrTxBbrui VHznHhiy1nY4AGlHo4TMad8lahJu4FoFeTSyc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=fMpVW5HlanWGd0GZOgNbOHoi9BW3LiZcyWKmmSzr9pL2fvBFt8fywlwExQw4Cn5L9K m+UxGVv3xC/oDzyXZLRvbbwBCH2mNtzpFNTYC2PNGMK6b2z6wN5akmJDgedvhjRjKOSi oBP6efMX7SL4dydY2czxZcoNMywxzjpvhe0PM= MIME-Version: 1.0 Received: by 10.204.34.200 with SMTP id m8mr168911bkd.73.1251408688367; Thu, 27 Aug 2009 14:31:28 -0700 (PDT) In-Reply-To: <20090826003131.GC25183@thorin> References: <20090826003131.GC25183@thorin> Date: Thu, 27 Aug 2009 23:31:28 +0200 Message-ID: From: "Vladimir 'phcoder' Serbinenko" To: The development of GRUB 2 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) Subject: Re: [PATCH] UTF-8 to UTF-16 transformation 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: Thu, 27 Aug 2009 21:31:36 -0000 On Wed, Aug 26, 2009 at 2:31 AM, Robert Millan wrote: > On Mon, Aug 24, 2009 at 09:23:22PM +0200, Vladimir 'phcoder' Serbinenko w= rote: > >> 2009-08-24 =A0Vladimir Serbinenko =A0 >> >> =A0 =A0 =A0 UTF-8 to UTF-16 transformation. >> >> =A0 =A0 =A0 * conf/common.rmk (pkglib_MODULES): Add utf.mod >> =A0 =A0 =A0 (utf_mod_SOURCES): New variable. >> =A0 =A0 =A0 (utf_mod_CFLAGS): Likewise. >> =A0 =A0 =A0 (utf_mod_LDFLAGS): Likewise. >> =A0 =A0 =A0 * include/grub/utf.h: New file. >> =A0 =A0 =A0 * 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 add= ed? > 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 we= ll, > 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. > > GNU libc has "iconv" command and "iconv_*" facilities for charset convers= ion, > how about iconv.mod for consistency? > >> + =A0 =A0 =A0 if ((c & 0x80) =3D=3D 0x00) >> + =A0 =A0 =A0 =A0 code =3D c; >> + =A0 =A0 =A0 else if ((c & 0xe0) =3D=3D 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 > -- > Robert Millan > > =A0The DRM opt-in fallacy: "Your data belongs to us. We will decide when = (and > =A0how) you may access your data; but nobody's threatening your freedom: = we > =A0still allow you to remove your data and not access it at all." > > > _______________________________________________ > Grub-devel mailing list > Grub-devel@gnu.org > http://lists.gnu.org/mailman/listinfo/grub-devel > --=20 Regards Vladimir 'phcoder' Serbinenko Personal git repository: http://repo.or.cz/w/grub2/phcoder.git