On Thu, 2007-06-21 at 16:23 +0200, va:patrick.kranzlmueller wrote:
> the code below does not give a validation error when typing umlauts,  
> but the umlauts are not saved to the database.
> 
> al_re = re.compile(r'^\w+$', re.UNICODE)
> 
> def clean_last_name(self):
>      if 'last_name' in self.cleaned_data:
>          if not al_re.search(self.cleaned_data['last_name']):
>              raise forms.ValidationError('Error message.')
>          return self.cleaned_data['last_name']
> 
> when doing "print self.cleaned_data" I´m getting this:
> 'last_name': u'M\xfcller',
> 
> how am I supposed to deal with umlautes when using newforms?
> btw: all our data is utf-8

There are lots of little bugs like this on trunk at the moment. If you
want to use non-ASCII characters, switch to using the Unicode branch.
It's completely up-to-date with trunk (merged about twice a week,
providing there are no risky changes on trunk that haven't settled).

Part of the problem is that newforms (on trunk) tries hard to be
unicode-aware, but the transition from unicode to byestrings is not
handled well in other places in the framework. That is why we are making
all the changes on Unicode branch (which will soon be on trunk).

Regards,
Malcolm



--~--~---------~--~----~------------~-------~--~----~
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