I need to get binary data in a GET request in the Play Framework. This is used to get info_hash from BitTorrent clients.
I get the following:
byte[] infoHash = params.get("info_hash").getBytes("ISO-8859-1")
Unfortunately, all non-ascii characters are replaced with 0x3f.
PS I can get url encoded parameters from Http.Request.current (). Querystring, but this is a bad idea.
Update: I redefine the method play.data.parsing.UrlEncodedParser.parse(InputStream is)with my option, which uses ISO-8859-1 in the parameter instead of hard-coded UTF-8, as in the original, and everything works as it should. But I'm still looking for a better way, because I don't want to edit the sources.
source
share