Remove use of StandardCharsets as it is Java 7 and up.