code: public static String createString(byte[] bytes, String encoding) {
  
          String enc = encoding.intern();
          if (enc != OpenCms.getSystemInfo().getDefaultEncoding()) {
              enc = lookupEncoding(enc, null);
          }
          if (enc != null) {
              try {
                  return new String(bytes, enc);
              } catch (UnsupportedEncodingException e) {
                  // this can _never_ happen since the charset was looked up first
              }
          } else {
              if (LOG.isWarnEnabled()) {
                  LOG.warn(Messages.get().getBundle().key(Messages.ERR_UNSUPPORTED_VM_ENCODING_1, encoding));
              }
              enc = OpenCms.getSystemInfo().getDefaultEncoding();
              try {
                  return new String(bytes, enc);
              } catch (UnsupportedEncodingException e) {
                  // this can also _never_ happen since the default encoding is always valid
              }
          }
          // this code is unreachable in practice
          LOG.error(Messages.get().getBundle().key(Messages.ERR_ENCODING_ISSUES_1, encoding));
          return null;
      }
docs: Creates a String out of a byte array with the specified encoding, falling back
  to the system default in case the encoding name is not valid.<p>
  
  Use this method as a replacement for <code>new String(byte[], encoding)</code>
  to avoid possible encoding problems.<p>
  
  @param bytes the bytes to decode
  @param encoding the encoding scheme to use for decoding the bytes
  
  @return the bytes decoded to a String