Hi Max, Have you set your encoding to UTF-8 in the Myghty config as described here?
http://pylonshq.com/docs/internationalization.html#templating HTH James Max Ischenko wrote: > Hello, > > I am testing i18n support in Pylons and run into this error: > > > Myghty Template Error > > Error: Error(UnicodeDecodeError): 'ascii' codec can't decode byte 0xd0 > in position 0: ordinal not in range(128) > File: > /home/max/projects/dou-trunk/site/doupy/doupy/templates/pages/contacts.myt > line 3 > Context: 1: # encoding: utf-8 > 2: > 3: <h2><% _("Contacts") %></h2> > 4: > 5: > 6: > Traceback: > /home/max/projects/dou-trunk/site/doupy/doupy/templates/pages/contacts.myt:3 > > > Here is original traceback: > > File > '/home/max/projects/dou-trunk/site/doupy/doupy/controllers/page.py', > line 15 in index > return render_response('pages/%s.myt' % name, output_encoding='utf-8') > File > '/usr/lib/python2.4/site-packages/Pylons-0.9.3-py2.4.egg/pylons/templating.py', > > line 307 in render_response > response = pylons.Response(render(*args, **kargs)) > File > '/usr/lib/python2.4/site-packages/Pylons-0.9.3-py2.4.egg/pylons/templating.py', > > line 293 in render > namespace=kargs, **cache_args) > File '/usr/lib/python2.4/site-packages/Pylons- > 0.9.3-py2.4.egg/pylons/templating.py', line 206 in render > return engine_config['engine'].render(namespace, template=full_path, > File > '/usr/lib/python2.4/site-packages/Pylons-0.9.3-py2.4.egg/pylons/templating.py', > > line 254 in render > global_args=global_args, out_buffer=buf, > File > '/usr/lib/python2.4/site-packages/Myghty-1.1-py2.4.egg/myghty/interp.py', > line 156 in execute > return self.make_request(component = component, **params).execute() > File > '/usr/lib/python2.4/site-packages/Myghty-1.1-py2.4.egg/myghty/request.py', > line 275 in execute > raise error > Error: Error(UnicodeDecodeError): 'ascii' codec can't decode byte 0xd0 > in position 0: ordinal not in range(128) at > /usr/lib/python2.4/site-packages/Myghty- > 1.1-py2.4.egg/myghty/requestbuffer.py line 367 > > Looks like it doesn't like my unicode message returned by gettext. > > I have tried to use ugettext but then Pylons complains it is not > available. I also tried to use Pylons 0.9.4.1 <http://0.9.4.1> but then > I get some strange error about do_run_component() function. > > Max. > > > --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
