make sure the method toCharset works with empty strings