From ca4c22cf9d1da831f1b4d250872262bf45b564f9 Mon Sep 17 00:00:00 2001 From: stevenpritchard Date: Sat, 11 Mar 2006 18:35:39 +0000 Subject: [PATCH] Force en_US.UTF-8. --- Changes | 4 +++- cpanspec | 8 +++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/Changes b/Changes index e52ac6a..cfda385 100644 --- a/Changes +++ b/Changes @@ -1,4 +1,4 @@ -0.61 2006-03-08 +0.61 2006-03-11 * Add this file. * Add some command-line options: @@ -12,5 +12,7 @@ * Fix path check to allow for a directory without a trailing /. (Found in Module::Install 0.59.) +* Force en_US.UTF-8. + https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=185192 # vi: set ai et: diff --git a/cpanspec b/cpanspec index 7d8825a..5ce93f7 100755 --- a/cpanspec +++ b/cpanspec @@ -10,7 +10,7 @@ # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # -# $Id: cpanspec,v 1.10 2006/03/11 18:24:45 stevenpritchard Exp $ +# $Id: cpanspec,v 1.11 2006/03/11 18:35:39 stevenpritchard Exp $ my $NAME="cpanspec"; my $VERSION='1.61'; @@ -178,6 +178,7 @@ use FileHandle; use Archive::Tar; use Archive::Zip qw(:ERROR_CODES); use POSIX; +use locale; use Text::Autoformat; use YAML qw(Load); use Module::CoreList; @@ -346,6 +347,11 @@ sub extract($$$) { } } +# Set locale to en_US.UTF8 so that dates in changelog will be correct +# if using another locale. Also ensures writing out UTF8. (Thanks to +# Roy-Magne Mo for pointing out the problem and providing a solution.) +setlocale(LC_ALL, "en_US.UTF-8"); + GetOptions( 'help|h' => \$help, 'old|o' => \$compat,