Replaces to_json and from_json with encode_json/decode_json to properly

handle non-ascii user input (e.g. MS Word apostrophe)
This commit is contained in:
Patrick Donelan 2009-01-19 03:33:07 +00:00
parent 2584482fcf
commit c4540a96ee
3 changed files with 9 additions and 9 deletions

View file

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