From d70ba71c7a0173991cddf9a43b4855864294c203 Mon Sep 17 00:00:00 2001 From: Slaven Rezic Date: Fri, 12 Feb 2010 21:47:01 +0100 Subject: [PATCH] added support for non-iso8859-1 terminals, see https://rt.cpan.org/Public/Bug/Display.html?id=35543 --- leo | 10 ++++++++++ 1 files changed, 10 insertions(+), 0 deletions(-) diff --git a/leo b/leo index f734249..e65c1b1 100755 --- a/leo +++ b/leo @@ -58,6 +58,8 @@ sub debug; my($o_s, $o_m, $o_c, $o_l, $o_v, $o_h, $o_n, $o_f, $o_d, $o_u, $o_p); +isatty(1) && eval q{ use open OUT => ':locale'}; + # # commandline options # @@ -95,6 +97,14 @@ if (!$string) { $string = ; chomp $string; } +if (eval { require I18N::Langinfo; require Encode; 1 }) { + my $codeset = I18N::Langinfo::langinfo(I18N::Langinfo::CODESET()); + if ($codeset) { + for ($string) { + $_ = Encode::decode($codeset, $_); + } + } +} # # open the config, if any -- 1.6.4.3