Skip Menu |

This queue is for tickets about the Gitalist CPAN distribution.

Report information
The Basics
Id: 52858
Status: resolved
Priority: 0/
Queue: Gitalist

People
Owner: Nobody in particular
Requestors: ilmari [...] ilmari.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



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
Subject: [PATCH] Decode getpwuid values
Date: Thu, 17 Dec 2009 11:18:53 +0000
To: bug-Gitalist [...] rt.cpan.org
From: Dagfinn Ilmari Mannsåker <ilmari [...] ilmari.org>
Gitalist::Git::Project does not decode the uid and gecos values in _build_owner, leading to double-encoded output when they're UTF-8 and possibly other breakage in other locales. This patch decodes the values according to the current locale.
On Thu Dec 17 06:26:59 2009, ilmari@ilmari.org wrote: Show quoted text
> Gitalist::Git::Project does not decode the uid and gecos values in > _build_owner, leading to double-encoded output when they're UTF-8 and > possibly other breakage in other locales. > > This patch decodes the values according to the current locale.
Nice one, thankyou for the patch! Zac
Released, thanks