Commit 1f3c1f3e authored by sikeda's avatar sikeda
Browse files

[bug] File names generated by some applications on Mac OS X (uploaded files,...

[bug] File names generated by some applications on Mac OS X (uploaded files, files in ZIP archive, ...) may not be shown correctly on other platforms: Accents are shown separately.  Fixed by applying Normalization Form C (NFC) to file names.


git-svn-id: https://subversion.renater.fr/sympa/branches/sympa-6.2-branch@12902 05aa8bb8-cd2b-0410-b1d7-8918dfa770ce
parent da786a3f
......@@ -377,8 +377,14 @@ our %cpan_modules = (
'gettext_id' => 'used to get time with sub-second precision',
},
# Unicode::GCString is included in Unicode-LineBreak.
'Unicode::Normalize' => {
required_version => '0.23', # Perl 5.8.1 bundles it.
package_name => 'Unicode-Normalize',
#mandatory => 1, # ...in the future.
'gettext_id' => 'Normalizes file names represented by Unicode',
},
'URI::Escape' => {
required_version => '3.28', # Included in URI-1.35.
required_version => '3.28', # Included in URI-1.35.
package_name => 'URI',
mandatory => 1,
'gettext_id' =>
......
......@@ -36,6 +36,7 @@ use Unicode::GCString;
use URI::Escape qw();
use if (5.008 < $] && $] < 5.016), qw(Unicode::CaseFold fc);
use if (5.016 <= $]), qw(feature fc);
BEGIN { eval 'use Unicode::Normalize qw()'; }
use Sympa::Regexps;
......@@ -264,6 +265,11 @@ sub guessed_to_utf8 {
last if defined $utf8;
}
$utf8 = Encode::decode('iso-8859-1', $text) unless defined $utf8;
# Apply NFC: e.g. for modified-NFD by Mac OS X.
$utf8 = Unicode::Normalize::normalize('NFC', $utf8)
if $Unicode::Normalize::VERSION;
return Encode::encode_utf8($utf8);
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment