urlEncode gives wrong output for non-ASCII
ethercrow opened this issue · comments
Dmitry Ivanov commented
Prelude Network.HTTP> urlEncode "ололо"
"%04%3E%04%3B%04%3E%04%3B%04%3E"
while it should be "%D0%BE%D0%BB%D0%BE%D0%BB%D0%BE"
Max Bolingbroke commented
This bit me as well.
urlEncode "好" == "%59%7D"
Where in fact you should UTF-8 encode it before escaping, so that:
urlEncode "好" == "%E5%A5%BD"
Ganesh Sittampalam commented
Should be fixed by @batterseapower's patch - please reopen if there's any problem. I'll upload a new version with the change shortly.
Artem Sememov commented
urlEncode should not make any assumptions about text encoding. There is no requirement to encode the data only as utf-8. It is best if the user would select the text encoding or encode ByteString as is.
http://docs.oracle.com/javase/1.5.0/docs/api/java/net/URLEncoder.html