|
From: Stefan S. <st...@ze...> - 2001-03-30 18:09:02
|
On Fri, Mar 30, 2001 at 11:34:50AM -0500, Chris Nandor wrote: > At 18:09 +0200 2001.03.30, Stefan Strigler wrote: > >So for example instead an "=FC" there shows up an "=C3=BC" (I hope you= get the > >characters transmitted right ...). >=20 > Hm. I am not sure what the problem is, I don't do a lot of work with > XML::Parser directly. However, you might want to look into Unicode::Ma= p8: >=20 > http://search.cpan.org/search?dist=3DUnicode-Map8 >=20 Thanks for the hint, i think i got a solution: %<-------<schnipp>------- #!/usr/bin/perl -wl use Unicode::Map8; use Unicode::String qw(utf8 latin1); my $map =3D Unicode::Map8->new("latin1") || die; my $string =3D "Einsch=FCchterung geh=F6rt zur politischen Kultur"; print "original string -> $string\n"; print "broken string -> ", $map->tou($string), "\n"; print "repaired string -> ", $map->tou($string)->latin1, "\n"; %<-------<schnapp>------- So, after including libs from above in portald I changed char_handler to %<-------<schnipp>------- [ ... ] use Unicode::String qw(utf8 latin1); [ ... ] sub char_handler { my($p, $data) =3D @_; $data =3D~ s/\s/ /g; =20 $data =3D encode_entities(utf8($data)->latin1); if ($snatchtitle) { $title .=3D $data; } elsif ($snatchlink) { $link .=3D $data; } } %<-------<schnapp>------- And it seems to work now ... Greets Steve |