From 6a9e16374f1549c7e63c7cd1c0e6989b2fb32191 Mon Sep 17 00:00:00 2001 From: joey Date: Sat, 29 Jul 2006 21:04:31 +0000 Subject: * Locale patch from Faidon: - Adds a locale setting to setup files. - Proper local time, if the locale configuration option is used. - Support for UTF-8 (or ISO-8859-X) filenames in SVN. Before this patch, commiting (or even rcs_updating) on repositories with UTF-8 filenames was impossible. --- IkiWiki.pm | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'IkiWiki.pm') diff --git a/IkiWiki.pm b/IkiWiki.pm index 2b877a370..085953a17 100644 --- a/IkiWiki.pm +++ b/IkiWiki.pm @@ -49,9 +49,21 @@ sub defaultconfig () { #{{{ adminemail => undef, plugin => [qw{mdwn inline htmlscrubber}], timeformat => '%c', + locale => undef, } #}}} sub checkconfig () { #{{{ + # locale stuff; avoid LC_ALL since it overrides everything + if (defined $ENV{LC_ALL}) { + $ENV{LANG} = $ENV{LC_ALL}; + delete $ENV{LC_ALL}; + } + if (defined $config{locale}) { + eval q{use POSIX}; + $ENV{LANG} = $config{locale} + if POSIX::setlocale(&POSIX::LANG, $config{locale}); + } + if ($config{w3mmode}) { eval q{use Cwd q{abs_path}}; $config{srcdir}=possibly_foolish_untaint(abs_path($config{srcdir})); -- cgit v1.2.3