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

Re: debconf w/ charset encoding support



Hi,

At Thu, 19 Sep 2002 11:37:23 -0400,
Joey Hess wrote:

> I think that binmode should probably be set in
> /usr/share/perl5/Debconf/Templates.pm. Could you try it there?
> If that doesn't work, it may need to be put in
> /usr/share/perl5/Debconf/Db.pm, but I hope we can avoid that.

Modification of Templates.pm worked well.


> Of course perl itself supports unicode. It can even do encoding
> conversion without the need of an add-on module such as Text::Iconv,
> but I do not know if it uses its own internal tables; strace of
> perl using its Encode::from_to() function does not show it calling
> iconv() or gconv().

I imagine Text::Iconv is not UTF-8-aware at all, because it divides
a multibyte character (UTF-8 is multibyte; most of ISO-8859 characters
are two bytes and east Asian characters are three bytes) into two parts.

Doublewidth (wcwidth=2) or combining (wcwidth=0) character support
is another problem.  We will have to solve UTF-8-aware problem first,
and then, wcwidth problem can be solved.

I think that usage of Encode:: module will work fine, but I have some
questions.

debconf-1.2.x uses libtext-iconv-perl already.  Why don't we use this?

Encoding:: module is separated into a few sub-modules, like Encoding::JP
and so on.  This may cause complex implementation or inability of 
support of some encodings.

Iconv has "//TRANSLIT" feature, which is transliteration into similar
character if the exact character is not available in conversion from
large charset to small charset.  I don't know Perl's Encoding:: module
has similar features.

On the other hand, if we decide to use Encoding:: module, why don't we
use Encoding:: module also for encoding conversion where debconf-1.2.x
already uses Text::Iconv?  Encoding:: module is in "perl" package
which is expected to be installed in more systems than libtext-iconv-perl.

---
Tomohiro KUBOTA <kubota@debian.org>
http://www.debian.or.jp/~kubota/
"Introduction to I18N"  http://www.debian.org/doc/manuals/intro-i18n/



Reply to: