Warning: Can't synchronize with repository "(default)" (Unsupported version control system "svn": No module named svn). Look in the Trac log for more information.

Ticket #58 (closed defect: fixed)

Opened 14 years ago

Last modified 12 years ago

Need to be able to use encodings other than utf8

Reported by: kevin Owned by: anonymous
Priority: normal Milestone: 0.9
Component: TurboGears Version:
Severity: normal Keywords:
Cc:

Description (last modified by kevin) (diff)

soyangel at gmail submitted a patch to do this:

Index: turbogears/view.py
===================================================================
--- turbogears/view.py  (revisión: 72)
+++ turbogears/view.py  (copia de trabajo)
@@ -20,7 +20,8 @@
 variableProviders = []

 compiledTemplates = {}
-serializer = kid.HTMLSerializer(encoding="utf-8")
+defaultencoding = cherrypy.config.get("kid.encoding", "utf-8")
+serializer = kid.HTMLSerializer(encoding=defaultencoding)

 def lookupTemplate(classname, loadingSite=False):
    """Searches for a template along the Python path.
@@ -96,7 +97,7 @@
            info["tg_flash"] = None
        t = tclass(**info)
        t.std = stdvars()
-        return t.serialize(encoding="utf-8", output=format,
fragment=fragment)
+        return t.serialize(encoding=defaultencoding, output=format, fragment=fragment)


 def loadBaseTemplates():
Index: turbogears/quickstart/prod.cfg.source
===================================================================
--- turbogears/quickstart/prod.cfg.source       (revisión: 72)
+++ turbogears/quickstart/prod.cfg.source       (copia de trabajo)
@@ -16,6 +16,7 @@
 # VIEW

 # kid.outputformat="html"
+# kid.encoding="utf-8"

 # The sitetemplate is used for overall styling of a site that
 # includes multiple TurboGears applications
Index: turbogears/quickstart/dev.cfg.source
===================================================================
--- turbogears/quickstart/dev.cfg.source        (revisión: 72)
+++ turbogears/quickstart/dev.cfg.source        (copia de trabajo)
@@ -16,6 +16,7 @@
 # VIEW

 # kid.outputformat="html"
+# kid.encoding="utf-8"

 # The sitetemplate is used for overall styling of a site that
 # includes multiple TurboGears applications

Change History

comment:1 Changed 14 years ago by kevin

  • Description modified (diff)

comment:2 Changed 14 years ago by kevin

  • Status changed from new to closed
  • Resolution set to fixed
  • Description modified (diff)

committed in [79]

Note: See TracTickets for help on using tickets.