Opened 15 years ago
Closed 15 years ago
#12714 closed (invalid)
Encoding problem with Oracle + Django
Reported by: | wandenberg | Owned by: | nobody |
---|---|---|---|
Component: | Core (Other) | Version: | dev |
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: | no | UI/UX: | no |
Description
Hi,
I've noticed a problem with Oracle + Django concerning encoding.
In the file django/db/backends/oracle/base.py 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'"
Regards,
Wandenberg
Note:
See TracTickets
for help on using tickets.
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.