in reply to malformed UTF-8 character in JSON string

Edited to add: Haargs reply is a better explanation of the situation!

It seems that the response you got from the server is not properly encoded in UTF-8. You get an "ä" in "Europäische Union" (which causes the error message) as a one-byte character, which is then replaced by the unicode replacement character "\x{fffd}".

You can try to work around this by encoding the response yourself:

use Encode; my $content = decode_json(encode('UTF-8',$response->content));

But what's actually needed is to fix the server. JSON strings are supposed to be encoded in UTF-8.