Hi,

Am 2017-01-01 um 00:20 schrieb Jason Pyeron:
> Not exactly a valid test, besides it works for me. The issue is internal 
> ascii data being written as ascii but instructing consumers
> it is uft8. 
> 
> $ cat utf8_test.pl
> #!/usr/bin/perl
> #
> use strict;
> use File::Slurp;
> 
> my $inputfile = @ARGV[0];
> my $logfilecontent = read_file($inputfile);
> binmode(STDOUT, ":utf8");
> print $logfilecontent;
> 
> $ ./utf8_test.pl testlog.txt
> übersät
> 
> $ ./utf8_test.pl testlog.txt | hexdump -C
> 00000000  c3 bc 62 65 72 73 c3 a4  74 0a                    |..bers..t.|
> 0000000a
> 
> $ hexdump.exe -C testlog.txt
> 00000000  fc 62 65 72 73 e4 74 0a                           |.bers.t.|
> 00000008

What do you want to say with that? Your input is not in UTF-8.

Just for the record, the output what I posted originally:

% ./utf8_test.pl testlog
übersät
% ./utf8_test.pl testlog | hexdump -C
00000000  c3 83 c2 bc 62 65 72 73  c3 83 c2 a4 74 0a        |....bers....t.|
0000000e
% hexdump -C testlog
00000000  c3 bc 62 65 72 73 c3 a4  74 0a                    |..bers..t.|
0000000a

Bye
Willi

Reply via email to