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

Re: [perl #21395] rcatline doesn't grok utf8

Thread Previous | Thread Next
From:
Inaba Hiroto
Date:
February 28, 2003 18:18
Subject:
Re: [perl #21395] rcatline doesn't grok utf8
Message ID:
3E60192D.CC0E8E7D@st.rim.or.jp
Enache Adrian wrote:

> On Fri, Feb 28, 2003 at 12:20:31PM +0000, Nicholas Clark wrote:
> > $ perl5.8.0 -lwe '$_ = chr 128; binmode STDIN, ":utf8"; $_ .= <STDIN>; print ord $_' <testutf8
> > Malformed UTF-8 character (unexpected continuation byte 0x80, with no preceding start byte) in ord at -e line 1, <STDIN> line 1.
> > 0
> > $ ./perl -lwe '$_ = chr 128; binmode STDIN, ":utf8"; $_ .= <STDIN>; print ord $_' <testutf8
> > Malformed UTF-8 character (unexpected continuation byte 0x80, with no preceding start byte) in ord at -e line 1, <STDIN> line 1.
> > 0
>
> Sorry for the hasty patch. I just skipped the scalar-utf8/file-utf8 case.

I think also scalar-utf8/file-binary case should be considered.
The recently added macro `sv_catpvn_utf8_upgrade' may be useful.
--
        Inaba Hiroto    <inaba@st.rim.or.jp>



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