docs: private void updateEntityAndLang(final File inputFile) {
          //directory case
          if (inputFile.isDirectory()) {
              final File[] files = inputFile.listFiles();
              if (files != null) {
                  for (final File file : files) {
                      updateEntityAndLang(file);
                  }
              }
          }
          //html file case
          else if (FileUtils.isHTMLFile(inputFile.getName())) {
              //do converting work
              convertEntityAndCharset(inputFile, ATTRIBUTE_FORMAT_VALUE_HTML);
  
          }
          //hhp/hhc/hhk file case
          else if (FileUtils.isHHPFile(inputFile.getName()) ||
                  FileUtils.isHHCFile(inputFile.getName()) ||
                  FileUtils.isHHKFile(inputFile.getName())) {
              //do converting work
              convertEntityAndCharset(inputFile, ATTRIBUTE_FORMAT_VALUE_WINDOWS);
              //update language setting of hhp file
              final String fileName = inputFile.getAbsolutePath();
              final File outputFile = new File(fileName + FILE_EXTENSION_TEMP);
              //get new charset
              final String charset = charsetMap.get(ATTRIBUTE_FORMAT_VALUE_WINDOWS);
              BufferedReader reader = null;
              BufferedWriter writer = null;
              try {
                  //prepare for the input and output
                  final FileInputStream inputStream = new FileInputStream(inputFile);
                  final InputStreamReader streamReader = new InputStreamReader(inputStream, charset);
                  //wrapped into reader
                  reader = new BufferedReader(streamReader);
  
                  final FileOutputStream outputStream = new FileOutputStream(outputFile);
  
                  //convert charset
                  final OutputStreamWriter streamWriter = new OutputStreamWriter(outputStream, charset);
                  //wrapped into writer
                  writer = new BufferedWriter(streamWriter);
  
                  String value = reader.readLine();
                  while(value != null) {
                      if (value.contains(tag1)) {
                          value = replaceXmlTag(value, tag1);
                      } else if (value.contains(tag2)) {
                          value = replaceXmlTag(value, tag2);
                      } else if (value.contains(tag3)) {
                          value = replaceXmlTag(value, tag3);
                      }
  
                      //meta tag contains charset found
                      if (value.contains("Language=")) {
                          String newValue = langMap.get(langcode);
                          if (newValue == null) {
                              newValue = langMap.get(langcode.split("-")[0]);
                          }
                          if (newValue != null) {
                              writer.write("Language=" + newValue);
                              writer.write(LINE_SEPARATOR);
                          } else {
                              throw new IllegalArgumentException("Unsupported language code '" + langcode + "', unable to map to a Locale ID.");
                          }
  
                      } else {
                          //other values
                          writer.write(value);
                          writer.write(LINE_SEPARATOR);
                      }
                      value = reader.readLine();
                  }
              } catch (final FileNotFoundException e) {
                  logger.error(e.getMessage(), e) ;
              } catch (final UnsupportedEncodingException e) {
                  throw new RuntimeException(e);
              } catch (final IOException e) {
                  logger.error(e.getMessage(), e) ;
              } finally {
                  if (reader != null) {
                      try {
                          reader.close();
                      } catch (final IOException e) {
                          logger.error("Failed to close input stream: " + e.getMessage());
                      }
                  }
                  if (writer != null) {
                      try {
                          writer.close();
                      } catch (final IOException e) {
                          logger.error("Failed to close output stream: " + e.getMessage());
                      }
                  }
              }
              try {
                  deleteQuietly(inputFile);
                  moveFile(outputFile, inputFile);
              } catch (final Exception e) {
                  logger.error("Failed to replace " + inputFile + ": " + e.getMessage());
              }
          }
  
      }