CC: | Dagfinn Ilmari Mannsåker <ilmari [...] ilmari.org> |
Subject: | [PATCH] Decode getpwuid values |
Date: | Thu, 17 Dec 2009 11:18:54 +0000 |
To: | bug-Gitalist [...] rt.cpan.org |
From: | Dagfinn Ilmari Mannsåker <ilmari [...] ilmari.org> |
---
lib/Gitalist/Git/Project.pm | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/lib/Gitalist/Git/Project.pm b/lib/Gitalist/Git/Project.pm
index 72909d4..210f594 100644
--- a/lib/Gitalist/Git/Project.pm
+++ b/lib/Gitalist/Git/Project.pm
@@ -9,6 +9,8 @@ class Gitalist::Git::Project with Gitalist::Git::HasUtils {
use Moose::Autobox;
use List::MoreUtils qw/any zip/;
use DateTime;
+ use Encode qw/decode/;
+ use I18N::Langinfo qw(langinfo CODESET);
use Gitalist::Git::Object::Blob;
use Gitalist::Git::Object::Tree;
use Gitalist::Git::Object::Commit;
@@ -239,7 +241,7 @@ class Gitalist::Git::Project with Gitalist::Git::HasUtils {
}
method _build_owner {
- my ($gecos, $name) = (getpwuid $self->path->stat->uid)[6,0];
+ my ($gecos, $name) = map { decode(langinfo(CODESET), $_) } (getpwuid $self->path->stat->uid)[6,0];
$gecos =~ s/,+$//;
return length($gecos) ? $gecos : $name;
}
--
1.6.5