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:
Eric Brine
Date:
September 26, 2011 19:50
Subject:
Re: [perl #100058] Perl leaves broken UTF-8 in SVs whose UTF8 is set
Message ID:
CALJW-qGb=JFJwR+oKY4R06WDnLGACGsVt33yndHZG4C8RnayPA@mail.gmail.com
On Mon, Sep 26, 2011 at 4:55 PM, Tom Christiansen <tchrist@perl.com> wrote:

> The description in perlrun of what happens when you use :utf8 in the PERLIO
> envariable confuses me, because it says that that layer does not do
> validity
> checks, but as far as I can discern, it does.
>

The warning is coming from sprintf, not the layer.

$ perl -C0 -le 'print "\xC0\x81"' | perl -CS -nle1

$ perl -C0 -le 'print "\xC0\x81"' | perl -CS -MDevel::Peek -nle'Dump($_)'
SV = PV(0x9c72788) at 0x9c9ed98
  REFCNT = 1
  FLAGS = (POK,pPOK,UTF8)
  PV = 0x9ca1070 "\300\201"\0Malformed UTF-8 character (2 bytes, need 1,
after start byte 0xc0) in subroutine entry at -e line 1, <> line 1.
 [UTF8 "\x{0}"]
  CUR = 2
  LEN = 80

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