Minor fix. JSON no longer assumes proper utf8, but uses whatever off-brand locale a luser wants to use.

This commit is contained in:
Kaleb Murphy 2008-12-02 16:03:23 +00:00
parent a4207e7ec5
commit 5127a307b7
3 changed files with 9 additions and 9 deletions

View file

@ -9,7 +9,7 @@ sub new {
my $json = shift;
my $log = shift;
my $survey = shift;
my $temp = decode_json($json) if defined $json;
my $temp = from_json($json) if defined $json;
my $self = defined $temp ? $temp : {};
$self->{survey} = $survey;
$self->{log} = $log;
@ -84,7 +84,7 @@ sub freeze {
my %temp = %{$self};
delete $temp{log};
delete $temp{survey};
return encode_json( \%temp );
return to_json( \%temp );
}
#Hash the survey timed out?

View file

@ -53,7 +53,7 @@ sub new {
my $log = shift;
my $self = {};
$self->{log} = $log;
my $temp = decode_json($json) if defined $json;
my $temp = from_json($json) if defined $json;
$self->{sections} = defined $temp->{sections} ? $temp->{sections} : [];
$self->{survey} = defined $temp->{survey} ? $temp->{survey} : {};
bless( $self, $class );
@ -75,7 +75,7 @@ sub freeze {
my %temp;
$temp{sections} = $self->{sections};
$temp{survey} = $self->{survey};
return encode_json( \%temp );
return to_json( \%temp );
}
=head2 newObject ( $address )