#27219: Emoji don't work in TextFields using Oracle backend
----------------------------------------------+----------------------------
Reporter: dmedvinsky | Owner: nobody
Type: Bug | Status: new
Component: Database layer (models, ORM) | Version: 1.10
Severity: Normal | Keywords: oracle,
| unicode
Triage Stage: Unreviewed | Has patch: 1
Easy pickings: 0 | UI/UX: 0
----------------------------------------------+----------------------------
When using cx_Oracle as a backend, I can't use Emoji in TextFields, which
are stored as NCLOBs in the database. When inputting an emoji and saving
them in the database, upon retrieving I get four replacement charaters (�)
per emoji instead.
Django
[https://github.com/django/django/blob/18c72d59e0807dae75ac2c34890d08c1e0972d0a/django/db/backends/oracle/base.py#L44
uses hardcoded NLS_LANG=".UTF8"] variable, which is outdated, only
supports Unicode standard version 3 and cannot properly store 4-byte
characters. [https://docs.oracle.com/database/121/NLSPG/ch6unicode.htm
#NLSPG-GUID-EB57AB68-A390-4814-81DD-6B78D33310CC The Oracle documentation
recommends] using the AL32UTF8 encoding instead, which supports latest
Unicode standard and stores 4-byte characters properly.
The change that fixes the emoji for me:
https://github.com/django/django/pull/7241
I recognize that it needs some tests, so I seek the help from those with
better knowledge of Django test cases than me. If someone can kindly
direct me, I can create the test for this case.
--
Ticket URL: <https://code.djangoproject.com/ticket/27219>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/053.9b26a78c0e6be4f9d87524387e5c12fa%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.