Standard alternative to Encode::Locale ?
Greetings everybody,
In the package mime-support, priority “standard”, there is the program
“run-mailcap”, which is a Perl script. This program open files following their
media type and the mailcap system (in particular “/etc/mailcap”).
If the name of a file is not safe to be passed to the shell, run-mailap creates
a temporary file using the tempfile command from the debianutils package.
The problem (<http://bugs.debian.org/682900>) is that currently it is too
liberal into calling a filename unsafe; in particular it will refuse non-ASCII
characters. This means that users handling files in non-English languages
will have a degraded experience, for intance, the viewer invoked by run-mailcap
will not operate in the file's current directory, etc.
Unsafe file names are currently detected with “m![^a-z0-9,.:/@%^+=_-]!i”. I
attempted to replace this with “m![^[:alnum:],.:/@%^+=_-]!i”, but it only
works if the filename decoded with the Encode::decode function, which needs
to know the current locale. The Encode::Locale module works perfectly
for this, but is of priority “optional”…
Do you have suggestions to solve this problem without making mime-support's
depend on non-“standard” packages ?
Have a nice day,
--
Charles Plessy
Tsurumi, Kanagawa, Japan
Reply to: