My script is written in Perl and I started translating messages into German. French, … will follow soon.
I use
use POSIX;
use utf8;
binmode STDIN, ":utf8";
binmode STDOUT, ":utf8";
binmode STDERR, ":utf8";
use locale;
use Locale::gettext;
use Locale::Util qw ( set_locale );
and translate with “gettext()”
For ‘German’ (de_DE) I get the messages from …/locale/de/LC_MESSAGES/ptna.mo, so far so good.
I managed to make it work on my OpenSuse Linux (with tons of ‘locale -a’) and it now shows ü,Ü, ä, Ä, … correctly.
However, on a Debian with less “locale -a” it finds the message catalog but spoils the ü, Ü, …
Can’t make it work.
Debian-$ locale -a
C
C.UTF-8
de_DE.utf8
en_US.utf8
POSIX
ru_RU.utf8
Here’s the other part of the code
$ENV{'LANG'} = 'de_DE';
$ENV{'LANGUAGE'} = $ENV{'LANG'};
setlocale( LC_ALL, '' );
bindtextdomain( 'ptna', $PATH );
textdomain( "ptna" );
I also tried “de_DE.UTF-8” and ‘de_DE.utf8’ and setlocale(LC_ALL,‘de’,‘DE’) also set_locale(), … but it still spoils the ü, Ü, …
Access to Debian is via “ssh” though - does this make the difference.
I’m lost now - any help?
Toni