It implements request #65082 and adds options for replacing resp. ignoring invalid UTF-8 sequences for json_encode and json_decode.