perl-unicode

Re: C<use utf8> dynamic scope?

1999-05-10 11:29:29
At 07:32 AM 5/10/99 , Chaim Frenkel wrote:
"DH" == Dick Hardt <DickH(_at_)ActiveState(_dot_)com> writes:

DH> 3. C<use utf8> is dynamically scoped rather than lexically scoped
DH>    a) char_encoding is a local var
DH>    b) called routines inherit the encoding of the caller
DH>    c) user added functions work the same as built-ins like strlen()
      
DH> 1. Existing scripts will not break. Unless the C<use utf8> is added to a
DH> script, nothing new happens.

Err, How do you make it dynamic without breaking existing scripts/modules?


If there is no C<use utf8>, then everything works as before and nothing
breaks. Only when you add the pragma, will things change, and then the user
is knowing that things may not work as expected. I am assuming that for a
majority of modules, you would want the module to inherit the encoding, and
only modules that treat strings as binary data would break. Given that,
more things break if the pragma is NOT dynamic.

-- Dick

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