For the UNKNOWN encoding the JDBC driver has a default encoding name that is null. Calling ((String)s).getBytes(null) is an error and the apparent API is ((Encoding)e).encode((String)s) which handles the null case.
Kris Jurka