Back to index

plone3  3.1.7
getCharset.py
Go to the documentation of this file.
00001 ## Script (Python) "getCharset"
00002 ##title=Return the site charset
00003 ##bind container=container
00004 ##bind context=context
00005 ##bind namespace=
00006 ##bind script=script
00007 ##bind subpath=traverse_subpath
00008 ##parameters=
00009 from Products.CMFCore.utils import getToolByName
00010 
00011 properties = getToolByName(container, 'portal_properties', None)
00012 if properties is not None:
00013     site_properties = getattr(properties, 'site_properties', None)
00014     if site_properties is not None:
00015         return site_properties.getProperty('default_charset')
00016 
00017 return 'utf-8'