develooper Front page | perl.perl5.porters | Postings from September 2011

Re: [perl #100058] Perl leaves broken UTF-8 in SVs whose UTF8 is set

Thread Previous | Thread Next
From:
Tom Christiansen
Date:
September 28, 2011 16:57
Subject:
Re: [perl #100058] Perl leaves broken UTF-8 in SVs whose UTF8 is set
Message ID:
8366.1317254189@chthon
Karl Williamson <public@khwilliamson.com> wrote
   on Wed, 28 Sep 2011 17:35:01 MDT: 

> I do think that the buffer length should only be construed as bytes and 
> not characters.

Could you please explain why you think that?

Why not have 

    binmode(FH, ":utf8");
    $/ = \1000;
    $_ = <FH>;

mean

    binmode(FH, ":utf8");
    read(FH, $_, 1000);

I vagule feel like you should never have byte operation 
on an encoded stream.

But maybe I'm wrong.

--tom

Thread Previous | Thread Next


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