perl-unicode

Re: Unicode aware module

1999-04-22 10:02:25
At 01:01 PM 4/21/99 , Chaim Frenkel wrote:
But that's the problem. A module has to do something to _protect_
itself. And trying to move the problem to the other party, the caller
can't know when it has to turn off utf8 before calling a routine. It
may not even know that a sensitive routine was called.

Isn't this why any pragma that changes _semantics_ are scoped?

yes, so that the script writer can decide the context

So, module writers will have to "fix" and code that makes assumptions about
char size. You could consider this similar to writing subs that could be
either called directly or as method calls, and the sub having to figure out
how it was called.

A different example is modules used with threading. We have come across
several modules that assume that they are in a single threaded space and
store data in statics that is not valid between different interpretors. We
are having to find and "fix" this issue as well.

Then there is the question of what is character oriented and what is
not. And will it change over the life of perl.

      $foo = substring($exe, 32, 15); # Character or Byte?

good point -- this leads to the thought that there should be a pragma that
says "I want to deal with things as bytes" so that if there is a utf16
pragma in the future, you will not break code that is treating scrings as
binary data.

C<use byte> ???

-- Dick

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