Hello,
I'm new to Pyramid, and I'm having a tough time getting the encodings all
lined up. Here are my components:
pyodbc
mssql (I don't have a choice)
mako
sqlalchemy (declarative)
Here's the end of the stack trace I'm seeing:
File "c:\code\vision\bws\bws\templates/projects.mako", line 14, in render_body
<td>${project.name.decode('utf-8') | n}</td>
File "C:\code\vision\env\lib\encodings\utf_8.py", line 16, in decode
return codecs.utf_8_decode(input, errors, True)
UnicodeDecodeError: 'utf8' codec can't decode byte 0x92 in position 14: invalid
start byte
I've tried setting utf8 on the connection string to the database, in
my engine_from_config call, and I've looked into doing it in my view, too.
I'm not sure what is being set and what isn't. Here is some code I'm using:
sqlalchemy.url = mssql+pyodbc://WRJSQLVDW03/production?mssql.charset=UTF-8
engine = engine_from_config(settings, 'sqlalchemy.', encoding='UTF-8')
@view_config(route_name='projects', renderer='projects.mako')
For the last, I found a post about setting the charset with Template, but I
wasn't sure how to do it with view_config.
Could someone let me know how to get this encoding flowing all the way
through to the template?
Thanks,
Craig
--
You received this message because you are subscribed to the Google Groups
"pylons-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/pylons-discuss?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.