+2012-07-06 Andrew Ruthven
+ Correctly handle UTF-8 in the output from MythTV.
+
2012-06-14 Andrew Ruthven
Setting $0 stopped --help and -? from working, fix that.
use Pod::Usage;
use Config::Auto;
use Sys::SigAction qw/timeout_call/;
+use Encode;
# Try and load a config file first, and then allow the command line
# to over ride what is in the config file.
my $return_code_only = 0;
-my $VERSION = '0.10.2';
+my $VERSION = '0.10.3';
# Some display blocks are disabled by default:
$c->{'display'}{'Shows due to Auto Expire'} = 0;
if ($return_code_only) {
exit $exit_value;
} elsif (scalar(@{ $c->{'email'} }) == 0) {
+ if ($charset =~ /utf(-)?8/i) {
+ $output = encode('UTF-8', $output);
+ }
print "\n$output";
} else {
if ((! $c->{'email_only_on_alert'}) ||
die "Sorry, failed to fetch $url: " . $response->status_line . "\n"
unless $response->is_success;
+ my $content = $response->decoded_content;
+ if ($response->header('Content-Type') =~ /utf(-)?8/i) {
+ $content = encode('UTF-8', $content);
+ }
print $response->header('Content-Type') . "\n";
- print $response->decoded_content . "\n";
+ print $content . "\n";
exit 0;
}