perl-unicode

Re: Unicode aware module

1999-06-13 01:30:20
On Sat, Jun 12, 1999 at 02:55:35PM -0700, Gurusamy Sarathy wrote:
How this is related to what I wrote?  You cannot make

   to utf8 or not to utf8

decision based on some properties of a *program/subroutine*.  It is
the properlty of arguments to a subroutine, not of a subroutine.

Nope, "does this code operate on bytes or characters?" is a property
of the subroutine.  

Please tell me whether

   sub foo { return $1 if s/\btypedef\s+int\s+(\w+)// }

is operating on bytes or characters.  Now substitute the words there
by other words and repeat it again.

                    It has nothing to do with the data that may be
given to it.  IOW, C<use byte> is unrelated to utf8--it denotes
a property of the code.

Then we need to determine another way to say that the subroutine
operates on a *sequence of integers 0..255 packed into a sequence of
bytes* (which is C<no utf8>, required if we have a globalutf8 pragma).

I do not follow you: if we can detect a mismatch, why not do "a right
thing" instead of complaining?  (Of course, for performance issues
this should be switchable off.)

If you did the "right thing" automatically there would be no way
to tell if you got utf8 data when you were strictly just expecting
utf16 data.  So, no, you can't do the "right thing" automatically.

Why would you care if the answer is correct?

Ilya

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