Skip to content

Instantly share code, notes, and snippets.

@sortega
Created January 12, 2011 11:14
Show Gist options
  • Save sortega/776027 to your computer and use it in GitHub Desktop.
Save sortega/776027 to your computer and use it in GitHub Desktop.
Fix garbled encoding (latin1 reencoded as utf8)
#!/usr/bin/perl
use strict;
use Encode;
binmode( STDIN, ':utf8' );
binmode( STDOUT, ':latin1' );
while (<>) {
print Encode::decode('utf8', $_);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment