use Encode; eval {$respons = JSON::XS->new->decode (Encode::decode_utf8($res->decoded_content));}; print 'json decode error:'.$@ ."\n" if ($@);