develooper Front page | perl.i18n | Postings from June 2003

Text wrapping with multibyte/fullwidth/combining/etc support

Tomohiro KUBOTA
June 19, 2003 19:28
Text wrapping with multibyte/fullwidth/combining/etc support
Message ID:

I am Tomohiro KUBOTA, a Debian developer from Japan and interested
in internationalization including multibyte/fullwidth/combining
characters support.

I am now interested in writing a tiny internationalized substitution
of Text::Wrap module.  I wrote Text::Wrapi18n module.

Since I would like to upload my module(s) to CPAN, I would like to have
comments especially on naming of the modules.

Features of Text::Wrapi18n

 - In order to work in small systems (which don't have Encoding module),
   I/O is done in locale encoding.  Thus, it doesn't use UTF-8 conversion.
   (I wrote this module to be used in "debconf", a Debian configuration
   tool.  The limitation comes from this purpose.)
 - supports popular multibyte encodings such as UTF-8, EUC-JP, EUC-KR,
   GB2312, Big5, and Big5HKSCS.
 - supports popular non-regular 8bit encodings such as ISO-8859-11
   (as known as TIS-620 for Thai which needs combining characters)
 - supports fullwidth characters which occupy two columns per character
   on terminal (most of east Asian characters).
 - supports combining characters which occupy zero columns per character
   on terminal (diacritical marks, Thai, Vietnamese, and so on).
 - supports languages which don't use whitespaces between words.
   (Chinese and Japanese.  Any other languages?  Korean uses whitespaces
   between words.)

This module depends on another module Text::Charwidth which implements
wcwidth(), wcswidth(), and mblen().  These features are supplied as
standard functions in C while not available in Perl, and needed for
Text::Wrapi18n and other softwares which use text formatting.

These modules are available in

The file names like libtext-wrapi18n-perl_0.01.orig.tar.gz come from
Debian source packages.  I will use file names like
Text-Wrapi18n-0.01.tar.gz .

Tomohiro KUBOTA <> Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About