Emoji don't work in TextFields using Oracle backend
|Database layer (models, ORM)
|Patch needs improvement:
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 uses hardcoded NLS_LANG=".UTF8" variable, which is outdated, only supports Unicode standard version 3 and cannot properly store 4-byte characters. 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.