1

I have a legacy PostgreSQL-7.4 database with its data stored encoded in LATIN1. It's used by more than just one app, so changing its encoding is problematic.

I've got a Django 1.2 app, using psycopg2 to access the database. Django wants to work entirely in Unicode, which I understand. Is there a way for me to tell Django the database's encoding, and have it translate between encodings for me between the app and the db? Is there a place I can hook to do that myself?

psj
  • 164
  • 4
  • I have a similar problem using "MSSQL". How to tell Django that the database is actually Latin1? – Kaniabi Jan 07 '11 at 23:25

1 Answers1

1

Try to specify DATABASE_OPTIONS:

DATABASE_OPTIONS = {
    "charset": "iso-8859-1" #or latin1
}

From Django legacy database encoding

Community
  • 1
  • 1
Marius
  • 3,589
  • 3
  • 27
  • 30