Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the JSON-RPC-Dispatcher CPAN distribution.

Report information
The Basics
Id: 60367
Status: resolved
Priority: 0/
Queue: JSON-RPC-Dispatcher

People
Owner: Nobody in particular
Requestors: henryykt [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: Critical
Broken in: 0.0503
Fixed in: (no value)



Subject: Incorrect behaviour with UTF-8-encoded strings
It seems that UTF-8-encoded strings are not handled correctly. For example consider the following program that echoes the content of the first parameter: use JSON::RPC::Dispatcher; my $rpc = JSON::RPC::Dispatcher->new; sub echo { return $_[0]; } $rpc->register('echo', \&echo); $rpc->to_app; When calling the service from the webbrowser like this: http://localhost:5000/?method=echo;params=["déjà vu"];id=1 the expected result would be: {"jsonrpc":"2.0","id":"1","result":"déjà vu"} but instead the following is returned: {"jsonrpc":"2.0","id":"1","result":"déjà vu"} In acquire_procedures_from_post and acquire_procedure_from_get (both in JSON/RPC/Dispatcher.pm) parameters are decoded by calling from_json. Adding {utf8 => 1} as second param should fix this problem. Hope this helps.
Long time no speak! Thanks for finding this bug. I've just pushed 0.0504 to PAUSE for inclusion in the CPAN. It contains a test and fix for this bug.