From cdbc225e0bf5e5d08b42ce8abe0e1f78f1d635b5 Mon Sep 17 00:00:00 2001 From: Ian Kelly Date: Fri, 27 Mar 2009 19:52:47 +0000 Subject: [PATCH] [1.0.X] Fixed an issue with unicode being mangled in Oracle when the database character set is non-unicode. Backport of r10175 from trunk. git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.0.X@10176 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- django/db/backends/oracle/base.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/django/db/backends/oracle/base.py b/django/db/backends/oracle/base.py index be1c497898..185bd749da 100644 --- a/django/db/backends/oracle/base.py +++ b/django/db/backends/oracle/base.py @@ -14,6 +14,10 @@ except ImportError: # Oracle takes client-side character set encoding from the environment. os.environ['NLS_LANG'] = '.UTF8' +# This prevents unicode from getting mangled by getting encoded into the +# potentially non-unicode database character set. +os.environ['ORA_NCHAR_LITERAL_REPLACE'] = 'TRUE' + try: import cx_Oracle as Database except ImportError, e: