Closed haimich closed 9 years ago
I found that the error handling behavior was introduced with https://github.com/xp-framework/xp-framework/issues/324. After talking to @kiesel we decided that the following would be the best approach to fix the issue:
$request= new RestRequest($path, HttpConstants::GET, 'utf-8');
or $response->data($type, 'utf-8');
)For testing purposes: the hex code of the dash character I'm having trouble with is e2 80 93
("EN DASH").
Thank you for reporting this issue. The solution to pass a target encoding is basically OK as it's the way we've dealt with this in other APIs so far. The option to pass it to $response->data()
(and $response->content()
, by the way) is better since it's the response's encoding we're dealing with, not the request's.
Pull requests are welcome!
When trying to deserialize the JSON string
I get the following exception:
Allthough it looks like a dash the character is actually a little shorter than the normal dash.