Last active
December 22, 2015 10:29
-
-
Save tomcha/6459410 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl | |
use strict; | |
use warnings; | |
#use utf8; | |
use Data::Dumper; | |
binmode STDIN,":utf8"; | |
binmode STDOUT,":utf8"; | |
binmode STDERR,":utf8"; | |
chomp(my $filename = 'euc.txt'); | |
open my $fh,"<",$filename; | |
#binmode $fh,":encoding(euc-jp)"; | |
binmode $fh,":encoding(utf8)"; | |
my @lines = <$fh>; | |
close $fh; | |
for my $line (@lines){ | |
print $line; | |
} | |
open my $fhw,">","utf8.txt" or die; | |
binmode $fhw,":utf8"; | |
print $fhw @lines; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment