On Thu, Dec 2, 2010 at 6:43 AM, Anurag Chourasia <anurag.choura...@gmail.com> wrote: > Hi Ian, > Yes.....I set the NLS_LANG in my shell to UTF8 before trying this. > Query using Django model still fails (direct query using cx_Oracle works > fine) > Regards, > Anurag
Okay, so it would appear that the client encoding is not being honored by Oracle for some reason. Just to verify that Django is setting it correctly in the first place, would you please try the following in a Django shell and let me know what you get? >>> import os >>> print os.environ['NLS_LANG'] >>> from django.db import connection >>> connection.cursor() # Initialize the connection >>> print os.environ['NLS_LANG'] >>> print connection.connection.encoding >>> print connection.connection.nencoding If everything is correct then the second NLS_LANG should be ".UTF8" and both encodings should be "UTF-8". If that is the case then I think your next step should be to try the cx_Oracle mailing list. Perhaps Anthony or somebody else there will have some idea why cx_Oracle or OCI are returning strings with the wrong encoding. Otherwise, we will need to figure out why the client encoding is not being set correctly by Django. Ian -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.