Michael Radziej wrote: > Gábor Farkas: >> >> 1. we do not mandate yet that GET/POST data is in settings.DEFAULT_CHARSET > > We don't mandate any particular encoding in > settings.DEFAULT_CHARSET? Take a look at ticket #951 and the recent > discussion about it here.
i'm sorry, are you sure that it's http://code.djangoproject.com/ticket/951 ? > Generic views assume it, where? > and the models > assume that every bytestring they get is in UTF-8, so we already > have conflicting assumptions (when DEFAULT_CHARSET is not UTF-8). > The mysql backends fails if the default connection encoding as set > up with the database server is different from UTF-8. might be. i use utf-8 with postgres, so i haven't had any problem with these. but are you sure that the models assume utf-8? don't they simply take any bytestrings they get? > > This will probably all be fixed to use DEFAULT_CHARSET or even > unicode instead of UTF-8, but does anybody currently successfully > use a different DEFAULT_CHARSET with the present Django. > >> 2. generally playing these encode/decode games is not nice :) > > You don't get around it. Sigh. (except by switching django to unicode completely :) > > I particularly dislike what python is doing here. > > You shouldn't be able to call unicode(bytestring) or str(unicode) > without giving an encoding, same for comparing unicode and > bytestrings. Just go through the open tickets in newforms to see > why. If you would have to fill in an encoding, it would be obvious > what to do. But as it is, it's much too easy to forget, and then you > get code that only works for ASCII, and since the test data also > only contains ASCII data (quite naturally, since using English for > test cases is just normal), the test suite doesn't find these bugs. +1 btw. the same problem exists in java too ("String" vs "byte[]"). 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 -~----------~----~----~----~------~----~------~--~---
