Show
Ignore:
Timestamp:
10/02/04 07:48:56 (20 years ago)
Author:
jalet
Message:

Should now correctly deal with charsets both when storing into databases and when
retrieving datas. Works with both PostgreSQL and LDAP.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • pykota/trunk/cgi-bin/printquota.cgi

    r1693 r1761  
    2424# 
    2525# $Log$ 
     26# Revision 1.37  2004/10/02 05:48:56  jalet 
     27# Should now correctly deal with charsets both when storing into databases and when 
     28# retrieving datas. Works with both PostgreSQL and LDAP. 
     29# 
    2630# Revision 1.36  2004/09/02 10:34:09  jalet 
    2731# Fixed problem with mod_auth_ldap Apache module 
     
    195199    langs = [l.strip().split(';')[0] for l in languages.split(",")] 
    196200    return "%s_%s" % (langs[0], langs[0].upper()) 
     201     
     202def getCharsetPreference() : 
     203    """Returns the preferred charset.""" 
     204    charsets = os.environ.get("HTTP_ACCEPT_CHARSET", "no charset defined") 
     205    charsets = [l.strip().split(';')[0] for l in charsets.split(",")] 
     206    return charsets[0] 
    197207 
    198208class PyKotaReportGUI(PyKotaTool) : 
     
    351361if __name__ == "__main__" : 
    352362    os.environ["LC_ALL"] = getLanguagePreference() 
    353     admin = PyKotaReportGUI(lang=os.environ["LC_ALL"]) 
     363    admin = PyKotaReportGUI(lang=os.environ["LC_ALL"], charset=getCharsetPreference()) 
    354364    admin.form = cgi.FieldStorage() 
    355365    admin.guiAction()