Fix encoding handling in hypermedia api.