On Thu, 2007-07-05 at 01:10 -0700, koenb wrote: > Do I understand correctly that with the unicode branch, databases are > supposed to be providing and accepting utf-8 data ? This assumption is > ok for self-constructed databases, but I am interacting with a legacy > database that is in iso-8859-1 and I can't change that. > Is there a setting somewhere to indicate what character set the > database is using ?
No there is no setting for this because it can always be auto-detected and set. Remember that there is a difference between what the client side talks and what the database server wants to see ("client" here means the Python database wrapper). All Django database backends do conversion to and from the database client's expected character encoding. This might then be converted to an encoding suitable for the server or the database or database table in question (some databases allow per-table encoding, or even per-column). Obviously, if your database can only store iso8859-1 data, you will need to ensure you don't send it any data that cannot be re-encoded to this character set. There's no really good way to automatically handle restrictions of that nature -- the correct error handling depends on the application and user base -- so it is up to the developer to not submit invalid data. For most backends (I think Oracle is the exception), Django will not quietly throw away unencodable data. It (or the backend) will raise an encoding error. Regards, Malcolm -- Borrow from a pessimist - they don't expect it back. http://www.pointy-stick.com/blog/ --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---