hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jaime Hablutzel Egoavil <hablutz...@gmail.com>
Subject Problem parsing non-ASCII in query component
Date Sat, 24 Dec 2016 23:26:40 GMT
Currently something like this:

public class ProblemWithNonAscii {
    public static void main(String[] args) {
        List<NameValuePair> pairs = URLEncodedUtils.parse("foo=bár",
StandardCharsets.UTF_8);
        System.out.println(pairs);
    }
}

produces this output:

[foo=b�r]

Where the 'á' character has been scrambled.

I can see that this is related to the following narrowing primitive
conversion,
https://github.com/apache/httpclient/blob/4.5.2/httpclient/src/main/java/org/apache/http/client/utils/URLEncodedUtils.java#L570
.

Is this a bug isn't it?.

-- 
Jaime Hablutzel -  RPC 994690880

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message