code: private static int getCcsid(Charset charset) {
          int ccsid = 0;
  
          // Bail out if the charset is null
          if (charset == null) {
              return 0;
          }
  
          // Try the name first
          if (ccsid == 0) {
              ccsid = getCcsid(charset.name());
          }
  
          // Try the aliases
          if (ccsid == 0) {
              for (String encoding : charset.aliases()) {
                  ccsid = getCcsid(encoding);
                  if (ccsid > 0) {
                      break;
                  }
              }
          }
  
          return ccsid;
      }
docs: Get the character code set identifier for the specified {@link Charset}.
  
  @param charset the charset
  
  @return the code set for the specified charset or 0 if the code set could
  not be determined