Created
September 27, 2012 02:33
-
-
Save grantm/3791850 to your computer and use it in GitHub Desktop.
Best efforts decoding of output from diff command
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
diff --git a/lib/MetaCPAN/Server/Diff.pm b/lib/MetaCPAN/Server/Diff.pm | |
index 2f90e6e..98c6306 100644 | |
--- a/lib/MetaCPAN/Server/Diff.pm | |
+++ b/lib/MetaCPAN/Server/Diff.pm | |
@@ -2,6 +2,7 @@ package MetaCPAN::Server::Diff; | |
use Moose; | |
use IPC::Run3; | |
+use Encoding::FixLatin qw(fix_latin); | |
has git => ( is => 'ro', required => 1 ); | |
has [qw(source target)] => ( is => 'ro', required => 1 ); | |
@@ -17,7 +18,7 @@ sub _build_raw { | |
(my $stats = $raw ) =~ s/^([^\n]*\0).*$/$1/s; | |
$self->numstat($stats); | |
$raw = substr($raw, length($stats)); | |
- return $raw; | |
+ return fix_latin($raw); | |
} | |
sub _build_structured { |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment