[interchange] Assume JSON submissions are UTF-8
Jon Jensen <[email protected]> Thu, 07 Jul 2016 01:27:11 +0000
| Newsgroups | gmane.comp.web.interchange.cvs |
|---|---|
| Message-ID | <[email protected]> |
commit 17c71e346fd76bd88d46abff75516bbff2b4e7c6 Author: Jon Jensen <[email protected]> Date: Wed Jul 6 18:55:19 2016 -0600 Assume JSON submissions are UTF-8 That is the default, and the only encoding I've ever seen anyone use in the wild for JSON. The only other options are UTF-16 and UTF-32: https://tools.ietf.org/html/rfc7159#section-8.1 It's highly unlikely anyone is using those, and they would need manual hacking to accommodate anyway. lib/Vend/Server.pm | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) --- diff --git a/lib/Vend/Server.pm b/lib/Vend/Server.pm index e36a35f..425b6b4 100644 --- a/lib/Vend/Server.pm +++ b/lib/Vend/Server.pm @@ -24,7 +24,7 @@ package Vend::Server; use vars qw($VERSION $Has_JSON); -$VERSION = '2.107'; +$VERSION = '2.108'; use Cwd; use POSIX qw(setsid strftime); @@ -348,8 +348,8 @@ sub parse_cgi { $CGI::post_ref = $h->{entity}; undef $CGI::json_ref; eval { - $CGI::json_ref = JSON::from_json($$CGI::post_ref); - #::logDebug('json: %s', ::uneval($CGI::json_ref)); + $CGI::json_ref = JSON::decode_json($$CGI::post_ref); +#::logDebug('json: %s', ::uneval($CGI::json_ref)); if ($Global::UnpackJSON && ref $CGI::json_ref eq 'HASH') { @CGI::values{keys %$CGI::json_ref} = values %$CGI::json_ref;