Fix use of JDK6 API (String.getBytes(Charset)).