From 8bc68269d3aa2144b7f0e3838f063c0ac7a47fc9 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Tue, 22 Sep 2015 19:47:02 +0200 Subject: StopFinder: Return data with proper encoding --- lib/Travel/Status/DE/HAFAS/StopFinder.pm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'lib/Travel/Status') diff --git a/lib/Travel/Status/DE/HAFAS/StopFinder.pm b/lib/Travel/Status/DE/HAFAS/StopFinder.pm index b654d84..f29d24c 100644 --- a/lib/Travel/Status/DE/HAFAS/StopFinder.pm +++ b/lib/Travel/Status/DE/HAFAS/StopFinder.pm @@ -8,6 +8,7 @@ use utf8; no if $] >= 5.018, warnings => 'experimental::smartmatch'; use Carp qw(confess); +use Encode qw(decode); use JSON; use LWP::UserAgent; @@ -54,7 +55,7 @@ sub new { return $ref; } - $ref->{raw_reply} = $reply->content; + $ref->{raw_reply} = $reply->decoded_content; $ref->{raw_reply} =~ s{ ^ SLs [.] sls = }{}x; $ref->{raw_reply} =~ s{ ; SLs [.] showSuggestion [(] [)] ; $ }{}x; @@ -84,7 +85,7 @@ sub results { push( @{ $self->{results} }, { - name => $result->{value}, + name => decode('iso-8859-15', $result->{value}), id => $result->{extId} } ); -- cgit v1.2.3