Created
November 27, 2014 14:46
-
-
Save niczero/af29d23d13aca1cd04ea to your computer and use it in GitHub Desktop.
How to handle encodings on input/output
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
open my $handle, '<:encoding(UTF-8)', $file; | |
open my $handle, '<:encoding(iso-8859-1)', $file; | |
open my $handle, '<', $file; | |
binmode $handle, ':encoding(UTF-8)'; | |
use open ':encoding(UTF-8)'; | |
use open ':encoding(iso-8859-1)'; | |
use open ':locale'; | |
use PerlIO::locale; | |
binmode STDOUT, ':locale'; | |
# see http://perlgeek.de/en/article/encodings-and-unicode | |
# see http://www.perl.com/pub/2012/04/perlunicook-standard-preamble.html |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment