develooper Front page | perl.perl5.porters | Postings from July 2016

[perl #128788] Can't turn off "does not map to Unicode" warnings

Thread Previous | Thread Next
Håkon Hægland
July 31, 2016 21:31
[perl #128788] Can't turn off "does not map to Unicode" warnings
Message ID:
# New Ticket Created by  Håkon Hægland 
# Please include the string:  [perl #128788]
# in the subject line of all future correspondence about this issue. 
# <URL: >

( Note: I first tried to send this as a followup to [perl #88592], but I
got reply from : "Could not find a ticket with id 88592" )

This bug:

( )

is still present in my perl 5.22.1. From the last post in the ticket it
seems like it was fixed with a pull request to the Encode module in october

$ perl -v
This is perl 5, version 22, subversion 1 (v5.22.1) built for
(with 58 registered patches, see perl -V for more detail)

Here is a test script:

use open qw( :std :utf8 );
use strict;
use warnings;
no warnings 'utf8';
my $bytes = "Test\x{E5}End";
my $fn = 'test.txt';
open ( my $fh, '>:raw', $fn ) or die "Could not open file '$fn': $!";
print $fh $bytes;
close $fh;
open ( $fh, "<:encoding(utf-8)", $fn ) or die "Could not open file '$fn':
my $str = do { local $/; <$fh> };
close $fh;

the output on my machine (x86_64 GNU/Linux):

utf8 "\xE5" does not map to Unicode at ./ line 11.

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About