I have some json I need to decode, alter and then encode without messing up any characters.
If I have a unicode character in a json string it will not decode. I\'m n
try setting the utf-8 encoding in your page:
utf-8
header('content-type:text/html;charset=utf-8');
this works for me:
$arr = array('tag' => 'Odómetro'); $encoded = json_encode($arr); $decoded = json_decode($encoded); echo $decoded->{'tag'};