summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Pointner <equinox@helsinki.at>2016-05-11 13:49:36 (GMT)
committerChristian Pointner <equinox@helsinki.at>2016-05-11 13:49:36 (GMT)
commit77ac165beeda872a7ba92efceb12faa2a3459e92 (patch)
treeb45c172e5a84f841f97c62cb576c174cda4da2d8
parent610c31e9361787250cad241babd99f5d2581d23a (diff)
moved to JSON::MaybeXS
-rw-r--r--README2
-rwxr-xr-xrh-bin/activesystem.json6
-rwxr-xr-xrh-bin/showlist.json6
3 files changed, 9 insertions, 5 deletions
diff --git a/README b/README
index 3b7d504..4b58c4e 100644
--- a/README
+++ b/README
@@ -25,7 +25,7 @@ LICENSE
Installation
============
-# sudo aptitude install apache2 libapache2-mpm-itk libapache2-mod-perl2 libjson-any-perl librhrd-perl libjs-jquery
+# sudo aptitude install apache2 libapache2-mpm-itk libapache2-mod-perl2 libjson-maybexs-perl librhrd-perl libjs-jquery
# sudo a2enmod ssl perl
# sudo /etc/init.d/apache2 restart
diff --git a/rh-bin/activesystem.json b/rh-bin/activesystem.json
index d65c6c4..c37c5c4 100755
--- a/rh-bin/activesystem.json
+++ b/rh-bin/activesystem.json
@@ -22,7 +22,7 @@
use strict;
use RHRD::rddb;
-use JSON;
+use JSON::MaybeXS;
use IO::Socket;
use Socket qw(SOCK_STREAM getaddrinfo);
@@ -64,9 +64,11 @@ $answer{'status'} = $status;
$answer{'errorstring'} = $errorstring;
$answer{'system'} = $system;
+my $j = JSON::MaybeXS->new(utf8 => 0);
+
print "Content-type: application/json; charset=UTF-8\n";
print "Status: $responsecode\n\n";
-print JSON->new->encode(\%answer);
+print $j->encode(\%answer);
diff --git a/rh-bin/showlist.json b/rh-bin/showlist.json
index 35d81e3..09f87b5 100755
--- a/rh-bin/showlist.json
+++ b/rh-bin/showlist.json
@@ -22,7 +22,7 @@
use strict;
use RHRD::rddb;
-use JSON;
+use JSON::MaybeXS;
my $status = 'ERROR';
my $errorstring = 'unknown';
@@ -57,6 +57,8 @@ $answer{'status'} = $status;
$answer{'errorstring'} = $errorstring;
$answer{'shows'} = \@showlist;
+my $j = JSON::MaybeXS->new(utf8 => 0);
+
print "Content-type: application/json; charset=UTF-8\n";
print "Status: $responsecode\n\n";
-print JSON->new->encode(\%answer);
+print $j->encode(\%answer);