this is the form code:

class ContactForm(forms.Form):
    subject = forms.CharField(max_length=255, label=_('Subject'))
    email = forms.EmailField(label=_('Email'))
    message = forms.CharField(max_length=1024, widget=Textarea,
label=_('Message'))

this is the view code:

def contacts_form(request, language = None):
    if request.method == 'POST':
        form = ContactForm(request.POST)
        if form.is_valid():
            # Do form processing here...
            return HttpResponseRedirect('/url/on_success/')
    else:
        form = ContactForm()
    return render_to_response('contacts/contacts_form.html', {'form':
form})

django rev 5511
in i18n i have two languages: english and russian.
DEFAULT_CHARSET = 'utf-8'
all files in utf-8
when i use russian as active language i has error:

Traceback (most recent call last):
File "c:\web\Python24\lib\site-packages\django\template\__init__.py"
in render_node
  738. result = node.render(context)
File "c:\web\Python24\lib\site-packages\django\template\__init__.py"
in render
  793. return self.encode_output(output)
File "c:\web\Python24\lib\site-packages\django\template\__init__.py"
in encode_output
  772. return str(output)
File "c:\web\Python24\lib\site-packages\django\utils\encoding.py" in
__str__
  31. return self.__unicode__().encode(settings.DEFAULT_CHARSET)
File "c:\web\Python24\lib\site-packages\django\newforms\forms.py" in
__unicode__
  76. return self.as_table()
File "c:\web\Python24\lib\site-packages\django\newforms\forms.py" in
as_table
  154. 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 "c:\web\Python24\lib\site-packages\django\newforms\forms.py" in
_html_output
  139. output.append(normal_row % {'errors': bf_errors, 'label':
label, 'field': unicode(bf), 'help_text': help_text})

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

i have seen "http://groups.google.ru/group/django-users/browse_thread/
thread/4baccb642ab6213e/ab6c37c6605544c0?lnk=gst&q=i18n
+newforms&rnum=1#ab6c37c6605544c0"
but there was no solution in that thread


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
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