Could somebody seriously help me out here? I got through the Unicode
issue and wrote some of my own validator code in formencode to except
strings in a more lenient way. I'm storing this away in MySQL with
the charset set to utf-8 with the default collation. Upon trying to
render this field in a Mako template, I get the following:
Module mako.runtime:91 in call_wno_caller
<< try:
self.__stack.append(None)
return callable_(*args, **kwargs)
finally:
self.__stack.pop()>> return callable_(*args,
**kwargs)
Module _web_base_tmpl:77 in body
<< # SOURCE LINE 45
context.write(u' <title>')
context.write(unicode(title))
context.write(u' | BLAH</title>\r\n')
# SOURCE LINE 46
>> context.write(unicode(title))
exceptions.UnicodeDecodeError: 'utf8' codec can't decode bytes in
position 14-18: unsupported Unicode code range
How do I get the string from the db to be unicode? Please help
thanks. Note that I added the following to my base controller:
import sys
reload(sys)
sys.setdefaulttype('utf-8')
So I'm wondering if Mako is requiring this setting but is not picking
it up.
Thanks,
Sam.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---