Thank you Gaetan,

I tried to add a BOM to the .po file but I got an error when compiling
the messages. (kind of expected)
Then I tried to add it at the beginning of my template file but keep
getting the same DjangoUnicodeDecodeError .

When you mention "save your source file with a BOM" which file do you
refer to?
I am using Linux BTW.

Traceback:
File "/usr/lib/python2.5/site-packages/django/core/handlers/base.py"
in get_response
  82.                 response = callback(request, *callback_args,
**callback_kwargs)
File "/home/mauro/qpe_site/main/engines/main_engine.py" in board_post
  329.     context_data={'form':form.as_table()}
File "/usr/lib/python2.5/site-packages/django/newforms/forms.py" in
as_table
  169.         return self._html_output(u'<tr><th>%(label)s</th><td>%
(errors)s%(field)s%(help_text)s</td></tr>', u'<tr><td colspan="2">%s</
td></tr>', '</td></tr>', u'<br />%s', False)
File "/usr/lib/python2.5/site-packages/django/newforms/forms.py" in
_html_output
  138.                     label = escape(force_unicode(bf.label))
File "/usr/lib/python2.5/site-packages/django/utils/encoding.py" in
force_unicode
  60.         raise DjangoUnicodeDecodeError(s, *e.args)

Exception Type: DjangoUnicodeDecodeError at /board/post
Exception Value: 'ascii' codec can't decode byte 0xe8 in position 0:
ordinal not in range(128). You passed in
<django.utils.functional.__proxy__ object at 0x881a4cc> (<class
'django.utils.functional.__proxy__'>)

Any other tip ? I've been stack for days here :(

Thank you,

//mauro//

On Apr 30, 10:33 pm, gcorneau <[EMAIL PROTECTED]> wrote:
> Yes: make sure you save your source file with a BOM. At least, that
> worked for me (I develop under Windows).
>
> I hope this helps,
> Gaetan
>
> On 30 avr, 10:06, Mauro <[EMAIL PROTECTED]> wrote:
>
> > On Apr 11, 6:43 am, gcorneau <[EMAIL PROTECTED]> wrote:
>
> > > # -*- coding: utf-8 -*-
> > > from django import newforms as forms
> > > from django.conf import settings
> > > from django.utils.translation importugettext_lazyas _
> > > from apparto.building import models
>
> > > class BuildingForm(forms.Form):
> > >     #~ contact = forms.ChoiceField()
>
> > >     civic_number = forms.IntegerField(label=_('Numéro'))
> > >     # Other fields omitted...
>
> > > When I navigate to this form, I get the following:
>
> > >DjangoUnicodeDecodeErrorat /apparto/account/addbuilding/
> > > 'ascii' codec can't decode byte 0xe9 in position 3: ordinal not in
> > > range(128). You passed in <django.utils.functional.__proxy__ object at
> > > 0x0180D170> (<class 'django.utils.functional.__proxy__'>)
> > > Request Method:         GET
> > > Request URL:    http://127.0.0.1/apparto/account/addbuilding/
> > > Exception Type:        DjangoUnicodeDecodeError
> > > Exception Value:        'ascii' codec can't decode byte 0xe9 in position 
> > > 3:
> > > ordinal not in range(128). You passed in
> > > <django.utils.functional.__proxy__ object at 0x0180D170> (<class
> > > 'django.utils.functional.__proxy__'>)
> > > Exception Location:     C:\Python25\Lib\site-packages\django\django\utils
> > > \encoding.py in force_unicode, line 60
> > > Python Executable:      C:\Python25\python.exe
> > > Python Version:         2.5.1
>
> > > Unicode error hint
>
> > > The string that could not be encoded/decoded was: Num?ro
>
> > > I made sure all my templates had {% load i18n %}
>
> > > I tried to reverse the French and English strings in the .po file and
> > > recompiled: no error when I switch languages.
>
> > > Did I simply forget something obvious?
>
> > I am having the exact same problem but with Japanese text, any
> > resolution? help?, tip?
>
> > //mauro//
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" 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/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to