Adrian Holovaty:
> On 2/15/07, Ivan Sagalaev <[EMAIL PROTECTED]> wrote:
>> I tried to show that it leaves out only two things:
>>
>> - if DEFAULT_CHARSET is different than DB charset it won't work (but
>> it's a weird situation, most legacy systems have one legacy encoding for
>> both)
>>
>> - it doesn't help if unicode is actually put into models or in raw SQL
>> manually but this bug was never about it anyway and won't break anything
>> since it fixes newforms, not backends
> 
> Hi Ivan,
> 
> Could you explain again why you think newforms should output
> clean_data as bytestrings rather than Unicode strings?

The current situation is this:

* newforms puts unicode into objects that used to receive only
  UTF-8 encoded bytestrings

* the models (and other parts) only work with bytestrings
  (or as long as the unicode contains only characters from ASCII)

* it is hard to convert all the rest of Django to be able to deal
  with unicode and bytestring at the same time, and it seems that
  this  has been postponed until after 1.0.

Ivan proposes a fix that tries to convert unicode to bytestrings at
the boundary of newforms by encoding unicode to bytestrings in
clean_data. (I have not checked whether this resolves all or at
least a big part of the problem, and I don't have a position about
this, yet.)

It looks like a step backwards, but as long is we don't try to make
everything unicode compatible at the same time, we need to encode
the unicode strings at some boundary or the other. Is clean_data the
right point for this?


Michael

-- 
noris network AG - Deutschherrnstraße 15-19 - D-90429 Nürnberg -
Tel +49-911-9352-0 - Fax +49-911-9352-100

http://www.noris.de - The IT-Outsourcing Company

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

Reply via email to