code: protected String getFileEncoding(CmsObject cms, String filename) {
  
          try {
              return cms.readPropertyObject(filename, CmsPropertyDefinition.PROPERTY_CONTENT_ENCODING, true).getValue(
                  OpenCms.getSystemInfo().getDefaultEncoding());
          } catch (CmsException e) {
              return OpenCms.getSystemInfo().getDefaultEncoding();
          }
      }
docs: Helper method to determine the encoding of the given file in the VFS,
  which must be set using the "content-encoding" property.<p>
  
  @param cms the CmsObject
  @param filename the name of the file which is to be checked
  @return the encoding for the file