Package: perl
Severity: important
Tags: l10n
Version: 5.10.0-19

If a perl-script uses the pragmas: "use utf8" and
"use open qw(:std :utf8)", then in case of system
error the message "$!" is not a utf8-string.

attache has example of script

result of test:

apache:[~]$ perl test.pl
Non-change error: ÐÐµÑ Ñакого Ñайла или каÑалога
Decoded error: Нет такого файла или каталога

apache:[~]$ locale
LANG=ru_RU.UTF-8
LC_CTYPE="ru_RU.UTF-8"
LC_NUMERIC="ru_RU.UTF-8"
LC_TIME="ru_RU.UTF-8"
LC_COLLATE="ru_RU.UTF-8"
LC_MONETARY="ru_RU.UTF-8"
LC_MESSAGES="ru_RU.UTF-8"
LC_PAPER="ru_RU.UTF-8"
LC_NAME="ru_RU.UTF-8"
LC_ADDRESS="ru_RU.UTF-8"
LC_TELEPHONE="ru_RU.UTF-8"
LC_MEASUREMENT="ru_RU.UTF-8"
LC_IDENTIFICATION="ru_RU.UTF-8"
LC_ALL=

--
... mpd is off

. ''`.                               Dmitry E. Oboukhov
: :’  :   email: un...@debian.org jabber://un...@uvw.ru
`. `~’              GPGKey: 1024D / F8E26537 2006-11-21
  `- 1B23 D4F8 8EC0 D902 0555  E438 AB8C 00CF F8E2 6537
#!/usr/bin/perl

use warnings;
use strict;

use utf8;
use open qw(:std :utf8);
use Encode qw(decode);

sub find_errror()
{
	for (my $i=0; ; $i++)
	{
		open my $file, '<', sprintf 'unknown_file_%d.txt', $i
		    or return;
	}
}

find_errror;
printf "Non-change error: %s\n", $!;
printf "Decoded error: %s\n", decode utf8=>$!;

Attachment: signature.asc
Description: Digital signature

Reply via email to