develooper Front page | perl.perl5.porters | Postings from February 2001

Re: The State of The Unicode

From:
Jarkko Hietaniemi
Date:
February 19, 2001 19:13
Subject:
Re: The State of The Unicode
Message ID:
20010219211328.L20429@chaos.wustl.edu
On Tue, Feb 20, 2001 at 03:02:00AM +0000, Simon Cozens wrote:
> > I'm saying you call an explicit function, eg to_utf8(), which gives
> > you back a string such that if you say "substr $str, 0, 1", you get
> > the first byte of the UTF-8 representation, and "length $str" is the
> > length of the UTF-8 representation.  Period.
> 
> I wonder if this would work:
> 
>     sub to_utf8 {
>         use bytes;
>         return $_[0]
>     }

Won't work quite like that, copying the $_[0] to the return stack
copies everything including the UTF8-ness, use bytes does not play
a role here.

-- 
$jhi++; # http://www.iki.fi/jhi/
        # There is this special biologist word we use for 'stable'.
        # It is 'dead'. -- Jack Cohen



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About