Meeting20100904: explicit-utf8-template-encoding.diff

File explicit-utf8-template-encoding.diff, 945 bytes (added by hodgestar, 20 months ago)

Patch to make Trac trunk (r10162) work with genshi-py3k branch.

  • trac/web/chrome.py

     
    775775            self.templates = TemplateLoader( 
    776776                self.get_all_templates_dirs(), auto_reload=self.auto_reload, 
    777777                max_cache_size=self.genshi_cache_size, 
     778                default_encoding="utf-8", 
    778779                variable_lookup='lenient', callback=lambda template: 
    779780                Translator(translation.get_translations()).setup(template)) 
    780781 
     
    848849 
    849850        try: 
    850851            buffer = StringIO() 
    851             stream.render(method, doctype=doctype, out=buffer) 
     852            stream.render(method, doctype=doctype, out=buffer, encoding="utf-8") 
    852853            return buffer.getvalue().translate(_translate_nop, 
    853854                                               _invalid_control_chars) 
    854855        except Exception, e: