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
From:
Håkon Hægland
Date:
July 31, 2016 21:31
Subject:
[perl #128788] Can't turn off "does not map to Unicode" warnings
Message ID:
rt-4.0.18-22509-1470000665-646.128788-75-0@perl.org
# 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: https://rt.perl.org/Ticket/Display.html?id=128788 >


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

This bug:

( https://rt.cpan.org/Public/Bug/Display.html?id=88592 )

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
2014...

$ perl -v
This is perl 5, version 22, subversion 1 (v5.22.1) built for
x86_64-linux-gnu-thread-multi
(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 ./p.pl line 11.


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