How can i handle 'unsupportedencodingexception in java'?

Example:

String s = new String(bytes, "UnsupportedEncoding");
Solution:

This error arises when the character encoding you've specified isn't supported. Ensure you're using a supported encoding, such as UTF-8.


String s = new String(bytes, "UTF-8");

Beginner's Guide to Java