Opened 6 years ago

Closed 6 years ago

#12714 closed (invalid)

Encoding problem with Oracle + Django

Reported by: wandenberg Owned by: nobody
Component: Core (Other) Version: master
Severity: Keywords: oracle encoding nls_lang
Cc: esportes3@… Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:



I've noticed a problem with Oracle + Django concerning encoding.
In the file django/db/backends/oracle/ the environment variable NLS_LANG is always changed to ".UTF8", but in some cases is necessary to change this.

I imagine is a better idea to have some code like this:

if not os.environ.has_key('NLS_LANG'):

os.environNLS_LANG? = '.UTF8'

Instead of "os.environNLS_LANG? = '.UTF8'"


Change History (1)

comment:1 Changed 6 years ago by ikelly

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Resolution set to invalid
  • Status changed from new to closed

Django uses the UTF-8 encoding to communicate with the database. There should never be any reason to change this setting, and if you do change it, expect to see Unicode decoding problems within Django. If for some reason you do find that this setting is unacceptable (e.g. another app within the same Apache instance uses a different client encoding), then the recommendation is to use cx_Oracle 5.0.1 or greater compiled with the WITH_UNICODE option; then the NLS_LANG setting will be irrelevant.

Since this appears to be just a hypothetical concern, I'm closing this ticket as invalid. If there is an actual bug that you've encountered, please open a new ticket with the specific details of that situation.

Note: See TracTickets for help on using tickets.
Back to Top