Thread "Wide character in print" klären (24 answers)
Opened by bianca at 2015-04-26 11:25

GwenDragon
 2015-04-27 08:46
#180831 #180831
User since
2005-01-17
14532 Artikel
Admin1
[Homepage]
user image
Testcase t.zip

t.pl:
Code (perl): (dl )
1
2
3
4
5
6
7
8
9
10
11
#!/usr/bin/perl

use strict; 
use warnings;

my $datei = 't.txt';
open(my $fh,'<',"$datei");
binmode($fh,':utf8');
local $/ = "\n";
my $content = <$fh>;
print $content;


und Textdatei t.txt (Windows-ANSI-kodiert) mit
Code: (dl )
Ä


ergibt:
utf8 "\xC4" does not map to Unicode at T:\t.pl line 10, <$fh> line 1.
Wide character in print at T:\t.pl line 11, <$fh> line 1.



Was hast du genau vor mit deinem Programm?
Warum binmode mit Encoding?
Welche Quellkodierung hat denn deine Datei?
Anhänge
application/zip
t.zip
die Drachin, Gwendolyn


Unterschiedliche Perl-Versionen auf Windows (fast wie perlbrew) • Meine Perl-Artikel

View full thread "Wide character in print" klären