How to use URLEncoder with UTF-8
The documentation says I should use UTF-8 with URLEncoder
I tried UTF-8. I get a “Unable to parse symbol” error
also tried, but the API level is higher than I would like (level 19).
String UTF_8 = java.nio.charset.StandardCharsets.UTF_8.toString();
What is the correct and easy way to use this method for UTF-8?
The correct way is to spell it correctly. Try
URLEncoder.encode(str, "UTF-8"); Do not use underscores.