public static String getEncoding ( CmsObject cms , CmsResource file ) { CmsProperty encodingProperty = CmsProperty . getNullProperty ( ) ; try { encodingProperty = cms . readPropertyObject ( file , CmsPropertyDefinition . PROPERTY_CONTENT_ENCODING , true ) ; } catch ( CmsException e ) { LOG . debug ( e . getLocalizedMessage ( ) , e ) ; } return CmsEncoder . lookupEncoding ( encodingProperty . getValue ( "" ) , OpenCms . getSystemInfo ( ) . getDefaultEncoding ( ) ) ; }
Returns the encoding of the file . Encoding is read from the content - encoding property and defaults to the systems default encoding . Since properties can change without rewriting content the actual encoding can differ .