Actually, I think it's position 0 of the argument to gettext, here's
the full exception:

Request Method:         GET
Request URL:    http://localhost:8080/
Exception Type:         UnicodeDecodeError
Exception Value:        'ascii' codec can't decode byte 0xe3 in position 0:
ordinal not in range(128)
Exception Location:     C:\Python25\lib\gettext.py in gettext, line 352

Traceback (most recent call last):
File "C:\Program Files\Google\google_appengine\lib\django\django
\template\__init__.py" in render_node
  723. result = node.render(context)
File "C:\Program Files\Google\google_appengine\lib\django\django
\templatetags\i18n.py" in render
  43. return translation.gettext(value)
File "C:\Program Files\Google\google_appengine\lib\django\django\utils
\translation\trans_real.py" in gettext
  265. return t.gettext(message)
File "C:\Python25\lib\gettext.py" in gettext
  352. return tmsg.encode(self._output_charset)

  UnicodeDecodeError at /
  'ascii' codec can't decode byte 0xe3 in position 0: ordinal not in
range(128)

There's a trace of the index.html template with this line highlighted:

63       <h1>{% trans "INDEX_TITLE" %}</h1>

This leads me to believe that somewhere in the data flow an ASCII
conversion is being used, despite my every effort to force UTF-8
everywhere.

On Feb 4, 2:39 am, Jarek Zgoda <jarek.zg...@gmail.com> wrote:
> If you call unicode() on unicode object such weirdness will happen.
>
> Position 0 suggests it's a very beginning of the text. Open index.html
> with hex editor and look for e3 byte value.
>
> On 3 Lut, 22:54, Scott <scott....@gmail.com> wrote:
>
> > Hello,
>
> > I'm seeing the following message when trying to render a template
> > using Unicode characters:
>
> > UnicodeDecodeError at /index.html
> > 'ascii' codec can't decode byte 0xe3 in position 0: ordinal not in
> > range(128)
>
> > I have both these settings using Unicode:
>
> > DEFAULT_CHARSET = 'utf-8'
> > FILE_CHARSET = 'utf-8'
>
> > As well as the meta in the header:
>
> > <meta http-equiv="content-type" content="text/html; charset=UTF-8" />
>
> > Finally, I have verified that the django.po files are properly encoded
> > as UTF-8 (they don't make it through the 'compilemessages' command if
> > they are not).
>
> > I'm not sure how Django is getting the idea that it should use an
> > ASCII codec, any ideas how I could get these templates rendering
> > correctly would be greatly appreciated.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to