class FileUtil {

  public static Charset getCharset() {
    final String cs =
        VulasConfiguration.getGlobal()
            .getConfiguration()
            .getString(VulasConfiguration.CHARSET, "UTF-8");
    try {
      return Charset.forName(cs);
    } catch (IllegalCharsetNameException | UnsupportedCharsetException unused) {
      log.error(
          "Defaulting to UTF-8 since charset with name ["
              + cs
              + "] cannot be created: "
              + unused.getMessage());
      return StandardCharsets.UTF_8;
    }
  }

}