#3924: Caught an exception while rendering: 'ascii' codec can't decode byte 0xc3
in position 8: ordinal not in range(128)
-------------------------------------+--------------------------------------
Reporter: [EMAIL PROTECTED] | Owner: hugo
Status: reopened | Component: Template system
Version: SVN | Resolution:
Keywords: | Stage: Accepted
Has_patch: 0 | Needs_docs: 0
Needs_tests: 0 | Needs_better_patch: 0
-------------------------------------+--------------------------------------
Comment (by anonymous):
Replying to [comment:16 mtredinnick]:
> Regarding comment 13, you didn't actually say what you did to cause the
error, just what you did to stop it. If you have a short example, could
you post it, please. I'd like to see somebody else's repeatable test cases
to ensure I am not missing anything.
Hello!
Here is an example:
tmp.py:
{{{
from django import newforms as forms
from django.shortcuts import render_to_response
from django.newforms.extras import SelectDateWidget
import datetime
class TestForm(forms.Form):
birthdate = forms.DateField(
widget =
SelectDateWidget(years=xrange(datetime.date.today().year,1900,-1))
)
def unicode_test(request):
form = TestForm()
return render_to_response('test.html', {'form': form})
}}}
test.html:
{{{
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Test</title>
</head>
<body>
{{ form }}
</body>
</html>
}}}
Also I have such setting:
{{{
LANGUAGE_CODE = 'de'
gettext = lambda s: s
LANGUAGES = (
('de', gettext('Greman')),
)
MIDDLEWARE_CLASSES = (
'django.contrib.csrf.middleware.CsrfMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.locale.LocaleMiddleware',
'django.middleware.common.CommonMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.middleware.doc.XViewMiddleware',
)
TEMPLATE_CONTEXT_PROCESSORS = (
"django.core.context_processors.auth",
"django.core.context_processors.debug",
"django.core.context_processors.i18n",
)
DATABASE_OPTIONS = {'charset': 'utf8'}
DEFAULT_CHARSET = 'utf-8'
}}}
--
Ticket URL: <http://code.djangoproject.com/ticket/3924#comment:20>
Django Code <http://code.djangoproject.com/>
The web framework for perfectionists with deadlines
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django updates" 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-updates?hl=en
-~----------~----~----~----~------~----~------~--~---