diff options
author | Daniel Friesel <derf@finalrewind.org> | 2015-03-12 13:19:51 +0100 |
---|---|---|
committer | Daniel Friesel <derf@finalrewind.org> | 2015-03-12 13:19:51 +0100 |
commit | a0f1dcc6eb29ac4c4e85985a4ae4e5631a3f9910 (patch) | |
tree | 8a62b7643a2df3ea7d2fe8a4ae457a2e0d81b063 | |
parent | f6c1b258b4be472933202f47aacd07c347b927af (diff) |
fucking encodings, how do they work
-rw-r--r-- | lib/Travel/Status/DE/URA.pm | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/Travel/Status/DE/URA.pm b/lib/Travel/Status/DE/URA.pm index e2f1c70..13c0f66 100644 --- a/lib/Travel/Status/DE/URA.pm +++ b/lib/Travel/Status/DE/URA.pm @@ -61,7 +61,7 @@ sub new { return $self; } - $self->{raw_str} = encode( 'UTF-8', $response->decoded_content ); + $self->{raw_str} = $response->decoded_content; # Fix encoding in case we're running through test files if ( substr( $self->{ura_instant_url}, 0, 5 ) eq 'file:' ) { @@ -84,7 +84,10 @@ sub parse_raw_data { if ( substr( $dep, 0, 1 ) != 4 ) { $csv->parse($dep); my @fields = $csv->fields; - push( @{ $self->{raw_list} }, \@fields ); + push( @{ $self->{raw_list} }, \@fields ); + for my $i ( 1, 6 ) { + $fields[$i] = encode( 'UTF-8', $fields[$i] ); + } push( @{ $self->{stop_names} }, $fields[1] ); } } |