summaryrefslogtreecommitdiff
path: root/Master/tlpkg/TeXLive
diff options
context:
space:
mode:
authorManuel Pégourié-Gonnard <mpg@elzevir.fr>2009-09-07 22:43:49 +0000
committerManuel Pégourié-Gonnard <mpg@elzevir.fr>2009-09-07 22:43:49 +0000
commitb7d70cabd9d223b8736e0877da5b0b0dbfa7b9bc (patch)
tree8b1259b1a11d07ad31f0ee8f3e1ad7e6e25d41bc /Master/tlpkg/TeXLive
parent60a09c6d83167b8ab4cc9c70908b8c8d48e92268 (diff)
Transliterate to ascii while importing text from the catalogue.
git-svn-id: svn://tug.org/texlive/trunk@15176 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/tlpkg/TeXLive')
-rw-r--r--Master/tlpkg/TeXLive/TeXCatalogue.pm11
1 files changed, 7 insertions, 4 deletions
diff --git a/Master/tlpkg/TeXLive/TeXCatalogue.pm b/Master/tlpkg/TeXLive/TeXCatalogue.pm
index a634e4d69bc..ad9d83c0ac6 100644
--- a/Master/tlpkg/TeXLive/TeXCatalogue.pm
+++ b/Master/tlpkg/TeXLive/TeXCatalogue.pm
@@ -10,7 +10,7 @@
use XML::Parser;
use XML::XPath;
use XML::XPath::XMLParser;
-use Encode;
+use Text::Unidecode;
package TeXLive::TeXCatalogue::Entry;
@@ -78,7 +78,9 @@ sub initialize {
my $docset = $parser->find('/entry/documentation');
foreach my $node ($docset->get_nodelist) {
my $docfile = $parser->find('./@href',$node);
- my $details = $parser->find('./@details',$node);
+ # see comments at end of beautify()
+ my $details = Text::Unidecode::unidecode(
+ $parser->find('./@details',$node));
my $language = $parser->find('./@language',$node);
$self->{'docs'}{$docfile}{'available'} = 1;
if ($details) { $self->{'docs'}{$docfile}{'details'} = $details; }
@@ -91,8 +93,9 @@ sub beautify{
$txt =~ s/\n/ /g;
$txt =~ s/^[[:space:]]*//g;
$txt =~ s/[[:space:]][[:space:]]*/ /g;
- # turn of the utf8 flag by encoding it to utf8
- return(Encode::encode("utf-8", $txt));
+ # transliterate to ascii: it allows the final tlpdb to be pure ascii,
+ # avoiding problems since we don't control the user's terminal encoding
+ return(Text::Unidecode::unidecode($txt));
}
sub name {