xgdlm wrote:
> Thanks for your reply Malcolm
>
>> Hmm... this precise example works for me. Are you using a reasonably
>> recent release (like 0.96)? I remember there was a unicode fix that went
>> in not too long ago to add smart_unicode() calls in various places for
>> things just like this.
>
> I'm running 0.96 and my newforms code is including the smart_unicode()
> fix posted a month ago.
>
>> If you are using a recent release, can you get rid of the call to
>> setdefaultencoding() and see if it still fails?
>
> I get rid of this hack but the problem still remain. As you mention
> the used codec is now utf8 rather than ascii ;)
>
> here is the complete debug :
>
> # python manage.py shell
> Python 2.4.3 (#1, Oct 27 2006, 16:05:30)
> [GCC 3.4.6 (Gentoo 3.4.6-r1, ssp-3.4.5-1.0, pie-8.7.9)] on linux2
> Type "help", "copyright", "credits" or "license" for more information.
> (InteractiveConsole)
>>>> from django.newforms import *
>>>> w = SelectMultiple()
>>>> print w.render('beatles', ['J', 'P', 'R'], choices=(('J', 'Johné'),('P',
>>>> 'Paulà')))
> Traceback (most recent call last):
> File "<console>", line 1, in ?
> File "/usr/lib/python2.4/site-packages/django/newforms/widgets.py",
> line 198, in render
> output.append(u'<option value="%s"%s>%s</option>' %
> (escape(option_value), selected_html,
> escape(smart_unicode(option_label))))
> File "/usr/lib/python2.4/site-packages/django/newforms/util.py",
> line 15, in smart_unicode
> s = unicode(s, settings.DEFAULT_CHARSET)
> UnicodeDecodeError: 'utf8' codec can't decode byte 0xe9 in position 4:
> unexpected end of data
>
>
>> If it does, then we need
>> to try and work out what is different between your system and mine a bit
>> more.
>
> So It seems this is a system problem and not django .. I whish I could
> find where and what to look for in order to solve this problem.
>
hi,
i think your problem might be with the "print" thing..
it prints the things to the console, so it's behavior depends on your
system's locale settings...
what is the output of running "locale" in a console?
gabor
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django developers" 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-developers?hl=en
-~----------~----~----~----~------~----~------~--~---