Skip to content

new <%namespace:defname> syntax doesn't handle multibyte chars #99

@sqlalchemy-bot

Description

@sqlalchemy-bot

Migrated issue, originally created by Michael Bayer (@zzzeek)

# coding: utf-8
from mako.template import Template

t = Template("""# coding: utf-8

<%def name="my_def(x)">
    x is: ${x}
</%def>

## old way 
${my_def(u'drôle de petit voix m’a réveillé')}

## new way
<%self:my_def x='drôle de petit voix m’a réveillé'/>

## workaround
<%self:my_def x="${u'drôle de petit voix m’a réveillé'}"/>

""")

print t.render_unicode().encode('utf-8')

Attachments: patch.txt

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions