comparison fetch_weather.pl @ 416:c88f7449b526

fetch_weather: Possibly another UTF8 fix :S
author Matti Hamalainen <ccr@tnsp.org>
date Sat, 07 Jan 2017 22:56:32 +0200
parents d623652df6b5
children 3c42ad35e157
comparison
equal deleted inserted replaced
415:ff932030a9b3 416:c88f7449b526
372 $fetch_meta = 1; 372 $fetch_meta = 1;
373 } 373 }
374 else 374 else
375 { 375 {
376 print STDERR "Using CACHED Tiehallinto static meta data from '$meta_file'.\n" if (opt_get_int("debug") > 0); 376 print STDERR "Using CACHED Tiehallinto static meta data from '$meta_file'.\n" if (opt_get_int("debug") > 0);
377 $meta_str = read_text($meta_file, "utf-8"); 377 $meta_str = read_text($meta_file);
378 } 378 }
379 379
380 print STDERR "Is meta_str UTF8? ".(utf8::is_utf8($meta_str) ? "yes" : "NO!")."\n" if (opt_get_int("debug") > 1); 380 print STDERR "Is meta_str UTF8? ".(utf8::is_utf8($meta_str) ? "yes" : "NO!")."\n" if (opt_get_int("debug") > 0);
381
381 382
382 # Parse the data .. 383 # Parse the data ..
383 my $meta_data = {}; 384 my $meta_data = {};
384 my $json = JSON->new->decode($meta_str); 385 my $json = JSON->new->decode($meta_str);
385 386