From faf16098516613c7e1f67d48ad7d1d927a0203af Mon Sep 17 00:00:00 2001 From: Ian Kelly Date: Fri, 27 Mar 2009 19:48:02 +0000 Subject: [PATCH] Fixed an issue with unicode being mangled in Oracle when the database character set is non-unicode. git-svn-id: http://code.djangoproject.com/svn/django/trunk@10175 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 6000e32f3a3..0a4ab3d0b11 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: