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.