code: private String getEncoding(CmsObject cms, CmsResource res) {
  
          String defaultEncoding = OpenCms.getSystemInfo().getDefaultEncoding();
          try {
              CmsProperty encProp = cms.readPropertyObject(res, CmsPropertyDefinition.PROPERTY_CONTENT_ENCODING, true);
              String encoding = encProp.getValue(defaultEncoding);
              return encoding;
          } catch (Exception e) {
              LOG.warn(e.getLocalizedMessage(), e);
              return defaultEncoding;
          }
      }
docs: Gets the encoding which should be used to read the properties file.<p>
  
  @param cms the CMS context to use
  @param res the resource for which we want the encoding
  
  @return the encoding value