What is the recommended way to handle an UnsupportedEncodingException when calling String.getBytes(\"UTF-8\") inside a library method?
If I\'m reading http://docs.orac
You know what I do?
return "blah".getBytes( Charset.forName( "UTF-8" ) );
This one doesn't throw a checked exception.
Update: Since Java 1.7, we have StandardCharsets.
return "blah".getBytes( StandardCharsets.UTF_8 );