I'm parsing some image links on wikipedia. I came across this one on http://en.wikipedia.org/wiki/Special:Export/Diego_Forl%C3%A1n
When i use the deprecated URLEncoder.encode, i can encode accented chars correctly, but when i specify the "UTF-8" argument, it fails. The text on wikipedia is utf8 AFAIK.
Diego+Forl%C3%A1n+vs+the+Netherlands.jpg is correct whereas Diego+Forl%E2%88%9A%C2%B0n+vs+the+Netherlands.jpg is incorrect.
scala> first
res24: String = Diego Forlán vs the Netherlands.jpg
scala> java.net.URLEncoder.encode(first, "UTF-8")
res25: java.lang.String = Diego+Forl%E2%88%9A%C2%B0n+vs+the+Netherlands.jpg
scala> java.net.URLEncoder.encode(first)
<console>:33: warning: method encode in object URLEncoder is deprecated: see corresponding Javadoc for more information.
java.net.URLEncoder.encode(first)
^
res26: java.lang.String = Diego+Forl%C3%A1n+vs+the+Netherlands.jpg