JSON: Encoder::str_encode replaced by json::encode

`Encoder::str_encode` is deprecated in favor of `encode`.