ak wrote:
> Ticket http://code.djangoproject.com/ticket/952 contain a complete
> solution of this problem and I don't know why it was not merged into
> the code but at the moment it is not matter and here is the reason why:
> Since newforms library was born and the decision about using unicode
> for clean_data was made, all these patches became unnecessary

Not at all. Anton, read my summary that I posted as a reply to Michael 
first post. Specifying database encoding and keeping internals in 
unicode are two separate issues. #952 is still necessary but not enough 
to fix your bug.

> because
> now developers must use only unicode everywhere (templates, db etc)

Actually the shouldn't :-). Newforms is now the only part of Django that 
works with unicode. I/O with th web (requests and templates) are now 
hotfixed to work with it in a way. Databases aren't.

> or
> manually recode all forms based on newforms from unicode to native
> encoding and back. Ofcourse this is stupid

May be it is. But it's a temporary inconvenience of newforms. Later 
database backend should do this automatically by using either 'utf-8' or 
DATABASE_CHARSET as I described in that my message.

BTW, there were ideas here about really really forcing users to migrate 
all data into unicode/utf-8 and be the first guy on the block that would 
lead the trend. This is noble but hard and if I remember correctly this 
was decided against...

> So, for me the quesion sounds like this: either newforms don't use
> unicode to store clean_data and we can keep using 'legacy' character
> sets, or django needs to drop all charsets support except of unicode.
> Or it should convert strings back and forth everywhere LOL

Incidentally you last 'LOL' is the option that Django have chosen :-). 
I'll try to explain.

'Unicode' is not a charset, or, more specifically, it is not represented 
with bytes. Python's native unicode string represent unicode characters 
in some internal format that just can't be dumped over the wire, be it 
to database or to the web. Because of this if Django would work 
internally in unicode it must encode everything it writes and decode 
everything it reads from outside. Converting from unicode to utf-8 is 
also encoding, and it does not happen automatically.

When you say that db backend supports 'unicode' it actually means that 
db library under Django backend does the encoding itself. But whether 
it's done in the library or in Django backend we still need a setting 
for charset. Two settings actually: for the web (that we already have) 
and for db (that is implemented in #952).

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