perl-unicode

Re: Unicode aware module

1999-06-12 09:46:18
On Sat, 12 Jun 1999 04:21:23 EDT, Ilya Zakharevich wrote:
On Fri, Jun 11, 1999 at 09:09:24PM -0700, Gurusamy Sarathy wrote:
But I dislike the idea of a global switch for utf8.  There
is no graceful way to detect if some code was never indended
to be run in utf8 mode (assume it processes GIF files, or
other random binary data).

It is simple.  If you have no global utf8 switch, you do not have utf8
capability in Perl.  Without it we finish with what we have now for
locale: you need 4 variants of every module:

      one for no locale no utf
      one for no locale utf
      one for locale no utf
      one for locale utf

(well, maybe 3, since the interaction of locales and utf is not clear).

I think you have a point about how _all_ modules would need
to have the chant C<use caller 'encoding'> to have a useful
utf8 application.

It seems better to have both C<use utf8> and C<use locale> have
a global effect, and add a lexically scoped C<use byte> (or
similar) that will mark places that operate on binary data,
and therefore turn off any encoding related pragmata.  What
do you think?


Sarathy
gsar(_at_)activestate(_dot_)com

<Prev in Thread] Current Thread [Next in Thread>