From 85fbafbbe7832797ef659ed1ed8c0a9caa94d799 Mon Sep 17 00:00:00 2001 From: starflowerbracken Date: Sat, 7 Dec 2019 06:19:25 +0000 Subject: [PATCH] Revert the unidecode lines (but not all changes) The lines added to remove unicode problems added more unicode rather than removing it. The other changes were left because they remove unbreaking spaces that somebody else has inserted. There may be other unicode problems arising in the future for similar reasons with other characters appearing. Need a better all-round solution without compounding the problem as I did. --- SearchEvents.pl | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/SearchEvents.pl b/SearchEvents.pl index 7db1a63..605b0c7 100644 --- a/SearchEvents.pl +++ b/SearchEvents.pl @@ -50,15 +50,11 @@ my $time = $data->{start}; #2018-08-30T07:00:00+00:00 my $slurl = $data->{hgurl}; - # following line added 2019-12-01 to decode unicode - use Text::Unidecode qw(unidecode); use HTML::Entities; $slurl = encode_entities($slurl); my $description = $data->{description}; - # fix 2019-12-01 in order to stop unicode problems - $description = unidecode(decode_entities($description)); - #$description = decode_entities($description); + $description = decode_entities($description); # remove any possible non-breaking spaces that will make the script fail $description =~ s/\xa0/ /g; $description =~ s/\xA0/ /g; @@ -74,9 +70,7 @@ utf8::decode($description); - # fix 2019-12-01 in order to stop unicode problems - $name = unidecode(decode_entities($description)); - #$name = decode_entities($name); + $name = decode_entities($name); # remove any possible non-breaking spaces that will make the script fail $name =~ s/\xa0/ /g; $name =~ s/\xA0/ /g;