From bf9bd2f0d22608a8d19d8d25b01265b1e030eeee Mon Sep 17 00:00:00 2001 From: Graham Knop Date: Tue, 10 Feb 2009 21:41:36 +0000 Subject: [PATCH] use proper JSON encoding/decoding --- lib/WebGUI/Asset/MatrixListing.pm | 2 +- lib/WebGUI/Asset/RichEdit.pm | 2 +- lib/WebGUI/Asset/Sku/EMSBadge.pm | 2 +- lib/WebGUI/Asset/Sku/EMSTicket.pm | 8 ++-- .../Asset/Wobject/EventManagementSystem.pm | 16 ++++---- lib/WebGUI/Asset/Wobject/Matrix.pm | 4 +- lib/WebGUI/Asset/Wobject/Thingy.pm | 38 +++++++++---------- lib/WebGUI/Operation/Spectre.pm | 2 +- lib/WebGUI/Operation/SpellCheck.pm | 2 +- lib/WebGUI/Shop/AddressBook.pm | 2 +- lib/WebGUI/Shop/CartItem.pm | 4 +- lib/WebGUI/Shop/Transaction.pm | 2 +- lib/WebGUI/Shop/TransactionItem.pm | 4 +- lib/WebGUI/Workflow/Cron.pm | 4 +- lib/WebGUI/Workflow/Instance.pm | 4 +- t/Asset/Sku/ProductCollateral.t | 2 +- t/Asset/Wobject/Matrix.t | 2 +- t/Asset/Wobject/Thingy.t | 8 ++-- 18 files changed, 54 insertions(+), 54 deletions(-) diff --git a/lib/WebGUI/Asset/MatrixListing.pm b/lib/WebGUI/Asset/MatrixListing.pm index eb63a433d..eb57921e0 100644 --- a/lib/WebGUI/Asset/MatrixListing.pm +++ b/lib/WebGUI/Asset/MatrixListing.pm @@ -902,7 +902,7 @@ sub www_getAttributes { my $jsonOutput; $jsonOutput->{ResultSet} = {Result=>\@results}; - return JSON->new->utf8->encode($jsonOutput); + return JSON->new->encode($jsonOutput); } #------------------------------------------------------------------- diff --git a/lib/WebGUI/Asset/RichEdit.pm b/lib/WebGUI/Asset/RichEdit.pm index 3d0d263b4..118277b9f 100644 --- a/lib/WebGUI/Asset/RichEdit.pm +++ b/lib/WebGUI/Asset/RichEdit.pm @@ -561,7 +561,7 @@ sub getRichEditor { while (my ($plugin, $path) = each %loadPlugins) { $out .= "tinymce.PluginManager.load('$plugin', '$path');\n"; } - $out .= "\ttinyMCE.init(" . JSON->new->utf8->pretty->encode(\%config) . " )\n" + $out .= "\ttinyMCE.init(" . JSON->new->pretty->encode(\%config) . " )\n" . ""; } diff --git a/lib/WebGUI/Asset/Sku/EMSBadge.pm b/lib/WebGUI/Asset/Sku/EMSBadge.pm index 14181b1de..cd34a748c 100644 --- a/lib/WebGUI/Asset/Sku/EMSBadge.pm +++ b/lib/WebGUI/Asset/Sku/EMSBadge.pm @@ -377,7 +377,7 @@ sub view { . WebGUI::Form::hidden($session, { name => "callback", - value => JSON->new->utf8->encode({ url => $self->getUrl}) + value => JSON->new->encode({ url => $self->getUrl}) }) . WebGUI::Form::submit($session, {value => $i18n->get("populate from address book")}) . WebGUI::Form::formFooter($session) diff --git a/lib/WebGUI/Asset/Sku/EMSTicket.pm b/lib/WebGUI/Asset/Sku/EMSTicket.pm index 512483ef0..839ee1f61 100644 --- a/lib/WebGUI/Asset/Sku/EMSTicket.pm +++ b/lib/WebGUI/Asset/Sku/EMSTicket.pm @@ -17,7 +17,7 @@ package WebGUI::Asset::Sku::EMSTicket; use strict; use base 'WebGUI::Asset::Sku'; use Tie::IxHash; -use JSON; +use JSON (); use WebGUI::Utility; =head1 NAME @@ -293,7 +293,7 @@ If specified, returns a single value for the key specified. sub getEventMetaData { my $self = shift; my $key = shift; - my $metadata = JSON->new->utf8->decode($self->get("eventMetaData") || '{}'); + my $metadata = JSON->new->decode($self->get("eventMetaData") || '{}'); if (defined $key) { return $metadata->{$key}; } @@ -438,7 +438,7 @@ sub processPropertiesFromFormPost { my $date = WebGUI::DateTime->new($self->session, time())->toDatabase; my $startDate = $form->process('startDate', "dateTime", $date, { defaultValue => $date, timeZone => $self->getParent->get("timezone")}); - $self->update({eventMetaData => JSON->new->utf8->encode(\%metadata), startDate => $startDate}); + $self->update({eventMetaData => JSON->new->encode(\%metadata), startDate => $startDate}); } #------------------------------------------------------------------- @@ -470,7 +470,7 @@ A hash reference containing all the metadata properties to set. sub setEventMetaData { my $self = shift; my $properties = shift; - $self->update({eventMetaData => JSON->new->utf8->encode($properties)}); + $self->update({eventMetaData => JSON->new->encode($properties)}); } #------------------------------------------------------------------- diff --git a/lib/WebGUI/Asset/Wobject/EventManagementSystem.pm b/lib/WebGUI/Asset/Wobject/EventManagementSystem.pm index cd0f42fb7..c6e5e781e 100644 --- a/lib/WebGUI/Asset/Wobject/EventManagementSystem.pm +++ b/lib/WebGUI/Asset/Wobject/EventManagementSystem.pm @@ -573,7 +573,7 @@ sub www_editBadgeGroup { my ($form, $db) = $self->session->quick(qw(form db)); my $f = WebGUI::HTMLForm->new($self->session, action=>$self->getUrl); my $badgeGroup = $db->getRow("EMSBadgeGroup","badgeGroupId",$form->get('badgeGroupId')); - $badgeGroup->{badgeList} = ($badgeGroup->{badgeList} ne "") ? JSON::decode_json($badgeGroup->{badgeList}) : []; + $badgeGroup->{badgeList} = ($badgeGroup->{badgeList} ne "") ? JSON::from_json($badgeGroup->{badgeList}) : []; my $i18n = WebGUI::International->new($self->session, "Asset_EventManagementSystem"); $f->hidden(name=>'func', value=>'editBadgeGroupSave'); $f->hidden(name=>'badgeGroupId', value=>$form->get('badgeGroupId')); @@ -842,7 +842,7 @@ sub www_getBadgesAsJson { $results{'sort'} = undef; $results{'dir'} = "asc"; $session->http->setMimeType('application/json'); - return JSON->new->utf8->encode(\%results); + return JSON->new->encode(\%results); } #------------------------------------------------------------------- @@ -974,7 +974,7 @@ sub www_getRegistrantAsJson { $badgeInfo->{ribbons} = \@ribbons; # build json datasource - return JSON->new->utf8->encode($badgeInfo); + return JSON->new->encode($badgeInfo); } #------------------------------------------------------------------- @@ -1038,7 +1038,7 @@ sub www_getRegistrantsAsJson { # build json datasource $session->http->setMimeType('application/json'); - return JSON->new->utf8->encode(\%results); + return JSON->new->encode(\%results); } @@ -1073,7 +1073,7 @@ sub www_getRibbonsAsJson { $results{'sort'} = undef; $results{'dir'} = "asc"; $session->http->setMimeType('application/json'); - return JSON->new->utf8->encode(\%results); + return JSON->new->encode(\%results); } @@ -1184,7 +1184,7 @@ className='WebGUI::Asset::Sku::EMSTicket' and state='published' and revisionDate my $description = $ticket->get('description'); my $data = $ticket->get('eventMetaData'); $data = '{}' if ($data eq ""); - my $meta = JSON->new->utf8->decode($data); + my $meta = JSON->new->decode($data); foreach my $field (@{$self->getEventMetaFields}) { my $label = $field->{label}; if ($field->{visible} && $meta->{$label} ne "") { @@ -1228,7 +1228,7 @@ className='WebGUI::Asset::Sku::EMSTicket' and state='published' and revisionDate $results{'sort'} = undef; $results{'dir'} = "asc"; $session->http->setMimeType('application/json'); - return JSON->new->utf8->encode(\%results); + return JSON->new->encode(\%results); } @@ -1263,7 +1263,7 @@ sub www_getTokensAsJson { $results{'sort'} = undef; $results{'dir'} = "asc"; $session->http->setMimeType('application/json'); - return JSON->new->utf8->encode(\%results); + return JSON->new->encode(\%results); } #------------------------------------------------------------------- diff --git a/lib/WebGUI/Asset/Wobject/Matrix.pm b/lib/WebGUI/Asset/Wobject/Matrix.pm index 2f749bede..aa9ae50d6 100644 --- a/lib/WebGUI/Asset/Wobject/Matrix.pm +++ b/lib/WebGUI/Asset/Wobject/Matrix.pm @@ -987,7 +987,7 @@ assetData.revisionDate my $jsonOutput; $jsonOutput->{ResultSet} = {Result=>\@results}; - my $encodedOutput = JSON->new->utf8->encode($jsonOutput); + my $encodedOutput = JSON->new->encode($jsonOutput); return $encodedOutput; } @@ -1090,7 +1090,7 @@ sub www_getCompareListData { $session->http->setMimeType("application/json"); - return JSON->new->utf8->encode($jsonOutput); + return JSON->new->encode($jsonOutput); } #------------------------------------------------------------------- diff --git a/lib/WebGUI/Asset/Wobject/Thingy.pm b/lib/WebGUI/Asset/Wobject/Thingy.pm index 188dc2baa..0ed898603 100644 --- a/lib/WebGUI/Asset/Wobject/Thingy.pm +++ b/lib/WebGUI/Asset/Wobject/Thingy.pm @@ -1517,7 +1517,7 @@ sub www_deleteThingDataViaAjax { unless ($thingId && $thingDataId) { $session->http->setStatus("400", "Bad Request"); - return JSON->new->utf8->encode({message => "Can't get thing data without a thingId and a thingDataId."}); + return JSON->new->encode({message => "Can't get thing data without a thingId and a thingDataId."}); } my $thingProperties = $self->getThing($thingId); @@ -1528,11 +1528,11 @@ sub www_deleteThingDataViaAjax { $self->deleteThingData($thingId,$thingDataId); $session->http->setMimeType("application/json"); - return JSON->new->utf8->encode({message => "Data with thingDataId $thingDataId was deleted."}); + return JSON->new->encode({message => "Data with thingDataId $thingDataId was deleted."}); } else { $session->http->setStatus("404", "Not Found"); - return JSON->new->utf8->encode({message => "The thingId you specified can not be found."}); + return JSON->new->encode({message => "The thingId you specified can not be found."}); } } @@ -2455,7 +2455,7 @@ sub www_editThingDataSaveViaAjax { unless ($thingId && $thingDataId) { $session->http->setStatus("400", "Bad Request"); - return JSON->new->utf8->encode({message => "Can't get thing data without a thingId and a thingDataId."}); + return JSON->new->encode({message => "Can't get thing data without a thingId and a thingDataId."}); } my $thingProperties = $self->getThing($thingId); @@ -2467,19 +2467,19 @@ sub www_editThingDataSaveViaAjax { if($thingDataId eq 'new' && $self->hasEnteredMaxPerUser($thingId)){ $session->http->setStatus("400", "Bad Request"); - return JSON->new->utf8->encode({message => $i18n->get("has entered max per user message")}); + return JSON->new->encode({message => $i18n->get("has entered max per user message")}); } my ($newThingDataId,$errors) = $self->editThingDataSave($thingId,$thingDataId); if ($errors){ $session->http->setStatus("400", "Bad Request"); - return JSON->new->utf8->encode($errors); + return JSON->new->encode($errors); } } else { $session->http->setStatus("404", "Not Found"); - return JSON->new->utf8->encode({message => "The thingId you requested can not be found."}); + return JSON->new->encode({message => "The thingId you requested can not be found."}); } } @@ -2568,7 +2568,7 @@ sub www_getThingViaAjax { unless ($thingId) { $session->http->setStatus("400", "Bad Request"); - return JSON->new->utf8->encode({message => "Can't return thing properties without a thingId."}); + return JSON->new->encode({message => "Can't return thing properties without a thingId."}); } my $thingProperties = $self->getThing($thingId); @@ -2586,11 +2586,11 @@ sub www_getThingViaAjax { $thingProperties->{field_loop} = \@field_loop; $session->http->setMimeType("application/json"); - return JSON->new->utf8->encode($thingProperties); + return JSON->new->encode($thingProperties); } else { $session->http->setStatus("404", "Not Found"); - return JSON->new->utf8->encode({message => "The thingId you requested can not be found."}); + return JSON->new->encode({message => "The thingId you requested can not be found."}); } } @@ -2620,11 +2620,11 @@ sub www_getThingsViaAjax { } } if (scalar @visibleThings > 0){ - return JSON->new->utf8->encode(\@visibleThings); + return JSON->new->encode(\@visibleThings); } else { $session->http->setStatus("404", "Not Found"); - return JSON->new->utf8->encode({message => "No visible Things were found in this Thingy."}); + return JSON->new->encode({message => "No visible Things were found in this Thingy."}); } } @@ -2982,7 +2982,7 @@ sub www_searchViaAjax { unless ($thingId) { $session->http->setStatus("400", "Bad Request"); - return JSON->new->utf8->encode({message => "Can't perform search without a thingId."}); + return JSON->new->encode({message => "Can't perform search without a thingId."}); } if ($thingProperties->{thingId}){ @@ -2993,11 +2993,11 @@ sub www_searchViaAjax { my $var = $self->getSearchTemplateVars($thingId,$thingProperties); $session->http->setMimeType("application/json"); - return JSON->new->utf8->encode($var); + return JSON->new->encode($var); } else { $session->http->setStatus("404", "Not Found"); - return JSON->new->utf8->encode({message => "The thingId you requested can not be found."}); + return JSON->new->encode({message => "The thingId you requested can not be found."}); } } @@ -3393,7 +3393,7 @@ sub www_viewThingDataViaAjax { unless ($thingId && $thingDataId) { $session->http->setStatus("400", "Bad Request"); - return JSON->new->utf8->encode({message => "Can't get thing data without a thingId and a thingDataId."}); + return JSON->new->encode({message => "Can't get thing data without a thingId and a thingDataId."}); } my $thingProperties = $self->getThing($thingId); @@ -3404,16 +3404,16 @@ sub www_viewThingDataViaAjax { my $output = $self->getViewThingVars($thingId,$thingDataId); if ($output){ - return JSON->new->utf8->encode($output); + return JSON->new->encode($output); } else{ $session->http->setStatus("404", "Not Found"); - return JSON->new->utf8->encode({message => "The thingDataId you requested can not be found."}); + return JSON->new->encode({message => "The thingDataId you requested can not be found."}); } } else { $session->http->setStatus("404", "Not Found"); - return JSON->new->utf8->encode({message => "The thingId you requested can not be found."}); + return JSON->new->encode({message => "The thingId you requested can not be found."}); } } diff --git a/lib/WebGUI/Operation/Spectre.pm b/lib/WebGUI/Operation/Spectre.pm index 62a426ff4..0a92f0628 100644 --- a/lib/WebGUI/Operation/Spectre.pm +++ b/lib/WebGUI/Operation/Spectre.pm @@ -97,7 +97,7 @@ sub www_spectreGetSiteData { } $siteData{cron} = \@schedules; } - return JSON::encode_json(\%siteData); + return JSON::to_json(\%siteData); } #------------------------------------------------------------------- diff --git a/lib/WebGUI/Operation/SpellCheck.pm b/lib/WebGUI/Operation/SpellCheck.pm index b5a0698d1..14c66a76a 100644 --- a/lib/WebGUI/Operation/SpellCheck.pm +++ b/lib/WebGUI/Operation/SpellCheck.pm @@ -200,7 +200,7 @@ sub www_spellCheck { # work around TinyMCE JSON encoding bug $data =~ s/([^\\](?:\\\\)*)\\'/$1'/g; - my $params = JSON->new->utf8->decode($data); + my $params = JSON->new->decode($data); my $result; # dispatch to different subs based on the 'method' in the JSON data diff --git a/lib/WebGUI/Shop/AddressBook.pm b/lib/WebGUI/Shop/AddressBook.pm index 6fda07211..a471b79c8 100644 --- a/lib/WebGUI/Shop/AddressBook.pm +++ b/lib/WebGUI/Shop/AddressBook.pm @@ -502,7 +502,7 @@ sub www_view { my $form = $session->form; my $callback = $form->get('callback'); $callback =~ s/'/"/g; - $callback = JSON->new->utf8->decode($callback); + $callback = JSON->new->decode($callback); my $callbackForm = ''; foreach my $param (@{$callback->{params}}) { $callbackForm .= WebGUI::Form::hidden($session, {name=>$param->{name}, value=>$param->{value}}); diff --git a/lib/WebGUI/Shop/CartItem.pm b/lib/WebGUI/Shop/CartItem.pm index 7ac28b9e1..c1c8c0e31 100644 --- a/lib/WebGUI/Shop/CartItem.pm +++ b/lib/WebGUI/Shop/CartItem.pm @@ -126,7 +126,7 @@ sub get { return {}; } else { - return JSON->new->utf8->decode($properties{id $self}{$name}); + return JSON->new->decode($properties{id $self}{$name}); } } return $properties{id $self}{$name}; @@ -306,7 +306,7 @@ sub update { $properties{$id}{$field} = (exists $newProperties->{$field}) ? $newProperties->{$field} : $properties{$id}{$field}; } if (exists $newProperties->{options} && ref($newProperties->{options}) eq "HASH") { - $properties{$id}{options} = JSON->new->utf8->encode($newProperties->{options}); + $properties{$id}{options} = JSON->new->encode($newProperties->{options}); } $self->cart->session->db->setRow("cartItem","itemId",$properties{$id}); } diff --git a/lib/WebGUI/Shop/Transaction.pm b/lib/WebGUI/Shop/Transaction.pm index 156397c73..8fb618a6a 100644 --- a/lib/WebGUI/Shop/Transaction.pm +++ b/lib/WebGUI/Shop/Transaction.pm @@ -711,7 +711,7 @@ sub www_getTransactionsAsJson { $results{'sort'} = undef; $results{'dir'} = "desc"; $session->http->setMimeType('application/json'); - return JSON->new->utf8->encode(\%results); + return JSON->new->encode(\%results); } #------------------------------------------------------------------- diff --git a/lib/WebGUI/Shop/TransactionItem.pm b/lib/WebGUI/Shop/TransactionItem.pm index dc8ddcc52..bef811aef 100644 --- a/lib/WebGUI/Shop/TransactionItem.pm +++ b/lib/WebGUI/Shop/TransactionItem.pm @@ -98,7 +98,7 @@ sub get { return {}; } else { - return JSON->new->utf8->decode($properties{id $self}{$name}); + return JSON->new->decode($properties{id $self}{$name}); } } return $properties{id $self}{$name}; @@ -294,7 +294,7 @@ sub update { $properties{$id}{$field} = (exists $newProperties->{$field}) ? $newProperties->{$field} : $properties{$id}{$field}; } if (exists $newProperties->{options} && ref($newProperties->{options}) eq "HASH") { - $properties{$id}{options} = JSON->new->utf8->encode($newProperties->{options}); + $properties{$id}{options} = JSON->new->encode($newProperties->{options}); } $properties{$id}{lastUpdated} = WebGUI::DateTime->new($self->transaction->session,time())->toDatabase; $self->transaction->session->db->setRow("transactionItem","itemId",$properties{$id}); diff --git a/lib/WebGUI/Workflow/Cron.pm b/lib/WebGUI/Workflow/Cron.pm index df71cb891..cb43f8d8b 100644 --- a/lib/WebGUI/Workflow/Cron.pm +++ b/lib/WebGUI/Workflow/Cron.pm @@ -117,7 +117,7 @@ sub get { my $name = shift; if ($name eq "parameters") { if (exists $self->{_data}{parameters} && $self->{_data}{parameters} ne "") { - my $parameters = JSON::decode_json($self->{_data}{$name}); + my $parameters = JSON::from_json($self->{_data}{$name}); return $parameters->{parameters}; } else { @@ -303,7 +303,7 @@ sub set { $self->{_data}{className} = (exists $properties->{className}) ? $properties->{className} : $self->{_data}{className}; $self->{_data}{methodName} = (exists $properties->{methodName}) ? $properties->{methodName} : $self->{_data}{methodName}; if (exists $properties->{parameters}) { - $self->{_data}{parameters} = JSON->new->utf8->pretty->encode({parameters => $properties->{parameters}}); + $self->{_data}{parameters} = JSON->new->pretty->encode({parameters => $properties->{parameters}}); } $self->{_data}{enabled} = 0 unless ($self->{_data}{workflowId}); my $spectre = WebGUI::Workflow::Spectre->new($self->session); diff --git a/lib/WebGUI/Workflow/Instance.pm b/lib/WebGUI/Workflow/Instance.pm index 71862a2ad..66cf61f3b 100644 --- a/lib/WebGUI/Workflow/Instance.pm +++ b/lib/WebGUI/Workflow/Instance.pm @@ -66,7 +66,7 @@ sub create { my ($isSingleton) = $session->db->quickArray("select count(*) from Workflow where workflowId=? and mode='singleton'",$placeHolders); my $sql = "select count(*) from WorkflowInstance where workflowId=?"; if (exists $properties->{parameters}) { - push @{ $placeHolders }, JSON->new->utf8->canonical->encode({parameters => $properties->{parameters}}); + push @{ $placeHolders }, JSON->new->canonical->encode({parameters => $properties->{parameters}}); $sql .= ' and parameters=?'; } else { @@ -466,7 +466,7 @@ sub set { $self->{_data}{className} = (exists $properties->{className}) ? $properties->{className} : $self->{_data}{className}; $self->{_data}{methodName} = (exists $properties->{methodName}) ? $properties->{methodName} : $self->{_data}{methodName}; if (exists $properties->{parameters}) { - $self->{_data}{parameters} = JSON->new->utf8->canonical->encode({parameters => $properties->{parameters}}); + $self->{_data}{parameters} = JSON->new->canonical->encode({parameters => $properties->{parameters}}); } $self->{_data}{currentActivityId} = (exists $properties->{currentActivityId}) ? $properties->{currentActivityId} : $self->{_data}{currentActivityId}; $self->session->db->setRow("WorkflowInstance","instanceId",$self->{_data}); diff --git a/t/Asset/Sku/ProductCollateral.t b/t/Asset/Sku/ProductCollateral.t index 2a3dd674f..4fcd790ba 100644 --- a/t/Asset/Sku/ProductCollateral.t +++ b/t/Asset/Sku/ProductCollateral.t @@ -56,7 +56,7 @@ ok($session->id->valid($vid), 'a valid id was generated for the new collateral e my $json; $json = $product->get('variantsJSON'); -my $jsonData = decode_json($json); +my $jsonData = JSON::from_json($json); cmp_deeply( $jsonData, [ {a => 'aye', b => 'bee', vid => $vid } ], diff --git a/t/Asset/Wobject/Matrix.t b/t/Asset/Wobject/Matrix.t index eaa90cee4..e4589a0c7 100644 --- a/t/Asset/Wobject/Matrix.t +++ b/t/Asset/Wobject/Matrix.t @@ -107,7 +107,7 @@ isa_ok($matrixListing, 'WebGUI::Asset::MatrixListing'); $session->user({userId => 3}); my $json = $matrix->www_getCompareFormData('score'); -my $compareFormData = JSON->new->utf8->decode($json); +my $compareFormData = JSON->new->decode($json); cmp_deeply( $compareFormData, diff --git a/t/Asset/Wobject/Thingy.t b/t/Asset/Wobject/Thingy.t index 537f2e796..04cdc1aba 100644 --- a/t/Asset/Wobject/Thingy.t +++ b/t/Asset/Wobject/Thingy.t @@ -86,7 +86,7 @@ is($thingy->get('defaultThingId'),$thingId,"The Thingy assets defaultThingId was $session->user({userId => 3}); my $json = $thingy->www_getThingViaAjax($thingId); -my $dataFromJSON = JSON->new->utf8->decode($json); +my $dataFromJSON = JSON->new->decode($json); cmp_deeply( $dataFromJSON, @@ -127,7 +127,7 @@ cmp_deeply( # the newly created thing. $json = $thingy->www_getThingsViaAjax(); -$dataFromJSON = JSON->new->utf8->decode($json); +$dataFromJSON = JSON->new->decode($json); cmp_deeply( $dataFromJSON, @@ -220,7 +220,7 @@ cmp_deeply( ); $json = $thingy->www_viewThingDataViaAjax($thingId,$newThingDataId); -$dataFromJSON = JSON->new->utf8->decode($json); +$dataFromJSON = JSON->new->decode($json); cmp_deeply( $dataFromJSON, @@ -268,7 +268,7 @@ $thingy->deleteThingData($thingId,$newThingDataId); is($thingy->getViewThingVars($thingId,$newThingDataId),undef,'Thing data was succesfully deleted, getViewThingVars returns undef.'); $json = $thingy->www_viewThingDataViaAjax($thingId,$newThingDataId); -$dataFromJSON = JSON->new->utf8->decode($json); +$dataFromJSON = JSON->new->decode($json); cmp_deeply( $dataFromJSON,