What sqlalchemy type are you using for the db field ?

On Wed, Aug 12, 2009 at 12:03 PM, Jonathan Vanasco<[email protected]> wrote:
>
> I keep getting a UnicodeDecodeError when trying to print out a db
> field ( through a sqlalchemy object ) that has an é in it
>
>    File '/FILE.mako.py', line 55 in render_body
>        __M_writer(unicode(item.field))
>    UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in
> position 3: ordinal not in range(128)
>
> I've tried many things.
>
> putting this at the top of FILE.mako didn't work
>    # -*- coding: utf-8 -*-
>
> my environment.py was already
>    config['pylons.g'].mako_lookup = TemplateLookup(
>        directories=paths['templates'],
>        error_handler=handle_mako_error,
>        module_directory=os.path.join(app_conf['cache_dir'],
> 'templates'),
>        input_encoding='utf-8', output_encoding='utf-8',
>        imports=['from webhelpers.html import escape'],
>        default_filters=['escape'])
>
> and trying this in environment.py didn't work
>    tmpl_options = config['buffet.template_options']
>    tmpl_options['mako.input_encoding'] = 'utf-8'
>    tmpl_options['mako.output_encoding'] = 'utf-8'
>
> does anyone have a suggestion ?
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to