code: private static Charset getCharset(File dictionaryFile)
  			throws UnsupportedCharsetException, FileNotFoundException {
  		
  		Charset cs = charsets.get(dictionaryFile);
  		if (cs == null) {
  			BufferedReader reader = null;
  			try {
  				reader = new BufferedReader(new FileReader(dictionaryFile));
  				String charsetName = reader.readLine();
  				charsetName = charsetName.replaceAll("\\s+", "");
  				cs = Charset.forName(charsetName);
  				charsets.put(dictionaryFile, cs);
  			} catch (IOException e) {
  				throw new RuntimeException("Could not read first line of file");
  			} finally {
  				if (reader != null) {
  					try {
  						reader.close();
  					} catch (IOException e) {
  						e.printStackTrace();
  					}
  				}
  			}
  		}
  		return cs;
  	}
docs: Reads the first line of the dictionary file which is the encoding
  @param dictionaryFile The dictionary file
  @return The encoding
  @throws FileNotFoundException if the dictionary file cannot be found.
  @throws UnsupportedCharsetException if the encoding of the file is not supported.