On Tue, 2007-04-10 at 10:02 +0200, Gábor Farkas wrote:
> hi,
> 
> i've been reading http://code.djangoproject.com/wiki/StringEncoding,
> 
> and the idea seems to be, that for "Passing Strings Between Django and 
> the Developer's Code",
> 
> django will/should accept both utf-8 encoded byte-strings, and 
> unicode-strings.
> 
> wouldn't it be simpler to only accept unicode-strings?

Simpler on one level (inside Django), much, much harder for simple cases
for developers.

> 
> or in other words: in which situations is it better, to also accept 
> utf-8 bytestrings?
> 
> for me it seems much more clean/strict/explicit/pythonic to assume that 
> all such strings are unicode.

It's a much tougher requirement on the developer. They have to change
every piece of their code. Instead, we can accept UTF-8 bytestrings or
unicode strings and large amounts of code will work unchanged.

There aren't actually that many places where strings go back and forth
between Django and the developers code, so doing the conversion to
Unicode, if necessary, at the Django interface isn't appearing to be
that hard.

It doesn't seem to be that expensive, performance-wise to allow
bytestrings, so I'd like to continue to do so. We only do the conversion
once (and check once in the no-conversion-required case).

Regards,
Malcolm



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

Reply via email to