Minor clean: align calculateCharset on 1.9 and return a Charset