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