Unicode Support in PLSQL Developer

Benjamin

Member
Hello I'm reaching out because I think I've run into a bug with PL/SQL Developer.
But I could be doing something wrong with some setting I'm missing.

Here's the scenario, I'm looking at Unicode support within our application and finding that when you insert characters into a table from PLSQL Developer. (I'm currently at Version 12.0.7.1837 but also tested this on version 15.0.1.2051 (64 bit) and he got the same result.)

Here's the problem, when I insert the first Emoji from the Unicode consortium's website (https://unicode.org/emoji/charts/full-emoji-list.html#1f600) using the windows + period (.), the character inserted is a different code point.

See code:
create table possedba.TestEmoji_t (
text varchar2(100 char)
);

insert into possedba.TestEmoji_t (Text)
values ('😀');
commit;

select Text, DUMP(Text, 1016) TextDump from possedba.TestEmoji_t;
--Returns: Typ=1 Len=6 CharacterSet=AL32UTF8: ed,a0,bd,ed,b8,80

This byte code returns a "invalid continuation byte" error from our application because it appears to be inserting with a different code point.

When I insert through SQLPlus I get the code point I am expecting:
create table possedba.TestSqlPlusEmoji_t (
text varchar2(100 char)
);

insert into possedba.TestSqlPlusEmoji_t (Text)
values ('😀');
commit;

select Text, DUMP(Text, 1016) TextDump from possedba.TestSqlPlusEmoji_t;
--Returns: CharacterSet=AL32UTF8: f0,9f,98,80

This code point returns what I would expect (f0,9f,98,80). This was displaying incorrectly until I turned on the Windows Locale to use UTF-8 and turned on PL/SQL Developer's Unicode support checkbox. Now the character displays correctly within PLSQL developer. But if I insert again it insertes the first code point still (ed,a0,bd,ed,b8,80).

Finally when I paste this emoji in python I get the same bytes back from the SQLPlus Test:
From Python 3.11:
>>> TestEmoji = '��'
>>> TestEmoji
'😀'
>>> TestEmoji.encode('utf-8')
b'\xf0\x9f\x98\x80'

When I test use the Unicode number from the consortium, I get the bytes that are present in SQLPlus, which indicates the SQLPlus encoding is working correctly:
>>> unicodeTestEmoji = u'\U0001F600'
>>> unicodeTestEmoji
'😀'
>>> unicodeTestEmoji.encode('utf-8')
b'\xf0\x9f\x98\x80'

It seems like PLSQL Developer is inserting the bytes for an old or incorrect character set encoding.
A coworker found this stack overflow (https://stackoverflow.com/questions/34409085/why-does-emoji-have-two-different-utf-8-codes-how-to-convert-emoji-from-utf-8) question that seemed to indicate those bytes (different emoji but the one with 6 bytes) might be coming from an old CESU-8 style encoding.

Can someone help with this? Am I just doing something wrong with my PLSQL Developer settings, or is this a Bug request that should be logged?

Thanks, here's some of my setup info:
NLS_LANG: AMERICAN_AMERICA.AL32UTF8
- This is set in the Registry for both 32-bit and 64-bit and environment variable.
Database Character Set: AL32UTF8
NLS_NCHAR_CHARACTERSET: AL16UTF16
Windows Locale: UTF-8 beta setting.
PLSQL Developer: 'Unicode enabled' flagged
Database Host OS: Linux x86 64-bit
Database Version: Oracle Database 19c Enterprise Edition Release 19.0.0.0.0
 
Can you try the same with the latest 15.0 version? If you are using the AL32UTF8 character set in 15.0, it should work.
 
Maybe this is an environment problem. Can you start PL/SQL Developer, connect to this database, go to Help > Support Info and send me the text from the "Info" tab page?
 
Hey! Sure yeah here is the info when connected to the AL32UTF8 database:

*Info Tab:*
PL/SQL Developer
Version 15.0.1.2051 (64 bit)
01.136644 - 50 user license
Service Contract: 7/1/2024
Style: Sky
Windows 10 Build 19045
en-US(1033)/English (United States)

Physical memory : 33,198,800 kB (5,053,128 available)
Paging file : 77,238,992 kB (28,756,112 available)
Virtual memory : 137,438,953,344 kB (137,434,150,160 available)

Parameters
C:\Program Files\PLSQL Developer 15\plsqldev.exe

Preferences
Session mode: Multi
OCI Library:
Use OCI7: False
Allow Multiple Connections: True

Preference Files
C:\Users\Benjamin.Albrecht\AppData\Roaming\PLSQL Developer 15\Preferences\default\Default.ini
C:\Users\Benjamin.Albrecht\AppData\Roaming\PLSQL Developer 15\Preferences\benjamin.albrecht\default.ini

License File
C:\Users\Benjamin.Albrecht\AppData\Roaming\PLSQL Developer 15\aalf.dat

Debug file
C:\Users\Benjamin.Albrecht\AppData\Roaming\PLSQL Developer 15\PlSqlDev.elf

Plug-Ins
*Active Query Builder (1.5.0) (C:\Program Files\PLSQL Developer 15\PlugIns\ActiveQueryBuilder.dll)
*PL/SQL Documentation (1.4.0) (C:\Program Files\PLSQL Developer 15\PlugIns\plsqldoc.dll)
(* is Active)

Aliases
dev820c
dev820m
PTCDB2
PTCDB4

Homes
OraClient19Home1 (C:\Oracle\product\19.3.0.0\client_64)

DLLs
C:\Oracle\product\19.3.0.0\client_64\bin\oci.dll

TNS File
C:\Posse\Settings\tnsadmin\tnsnames.ora

Using
Home: OraClient19Home1
DLL: C:\Oracle\product\19.3.0.0\client_64\bin\oci.dll
OCI: version 12.1 (19.3.0.0.0)
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0

Character Sets
Character size: 4 byte(s)
CharSetID: 873
NCharSetID: 2000
Unicode Support: True
NLS_LANG: AMERICAN_AMERICA.AL32UTF8
NLS_NCHAR_CHARACTERSET: AL16UTF16
NLS_CHARACTERSET: AL32UTF8

Process
Working Set = 182,427,648
Memory = 33,561,264
GDI Objects = 752
User Objects = 837
Handles = 816

Monitors
PixelsPerInch = 96

Id = 0
PPI = 96
Primary = False
Handle = 25827237
Left = 5120
Top = 344
Width = 1920
Height = 1080

Id = 1
PPI = 96
Primary = True
Handle = 45769219
Left = 0
Top = 0
Width = 2560
Height = 1440

Id = 2
PPI = 96
Primary = False
Handle = 9658293
Left = 2560
Top = 0
Width = 2560
Height = 1440

MainFormOnTaskbar = True

*Registry Tab:*
SOFTWARE\ORACLE
inst_loc = C:\Program Files\Oracle\Inventory

SOFTWARE\ORACLE\KEY_OraClient19Home1
ORACLE_HOME = C:\Oracle\product\19.3.0.0\client_64
ORACLE_HOME_NAME = OraClient19Home1
ORACLE_GROUP_NAME = Oracle - OraClient19Home1
NLS_LANG = AMERICAN_AMERICA.AL32UTF8
ORACLE_BUNDLE_NAME = Enterprise
OLEDBOLAP = C:\Oracle\product\19.3.0.0\client_64\oledbolap\mesg
OLEDB = C:\Oracle\product\19.3.0.0\client_64\oledb\mesg
ORACLE_HOME_TYPE = 2
ORACLE_SVCUSER = NT AUTHORITY\LOCAL SERVICE
ORACLE_SVCUSER_TYPE =
ORACLE_SVCUSER_PWDREQ = 0
SQLPATH = C:\Oracle\product\19.3.0.0\client_64\dbs
ORACLE_BASE = C:\Oracle
ORACLE_HOME_KEY = SOFTWARE\ORACLE\KEY_OraClient19Home1
MSHELP_TOOLS = C:\Oracle\product\19.3.0.0\client_64\MSHELP

SOFTWARE\ORACLE\KEY_OraClient19Home1\OLEDB
CacheType = Memory
EnableCmdTimeout = 0
ChunkSize = 100
DistribTX = 1
FetchSize = 100
OSAuthent = 0
PLSQLRset = 0
PwdChgDlg = 1
SchRstLng = 10000
UserDefFn = 0
DisableRetClause = 1
VCharNull = 1
SPPrmDefVal = 0
StmtCacheSize = 0
MetaDataCacheSize = 0
DBNotifications = 0
DeferUpdChk = 0

SOFTWARE\ORACLE\KEY_OraClient19Home1\OLEDBOLAP
OSAuthent = 0
PwdChgDlg = 1
PreserveMaxPrecision = 0

SOFTWARE\ORACLE\ODP.NET

SOFTWARE\ORACLE\ODP.NET\2.122.19.1
DllPath = C:\Oracle\product\19.3.0.0\client_64\bin
PromotableTransaction = promotable
SelfTuning = 1
StatementCacheWithUdts = 1
UdtCacheSize = 4096
PerformanceCounters = 0
MaxStatementCacheSize = 100
DemandOraclePermission = 0

SOFTWARE\ORACLE\ODP.NET\4.122.19.1
DllPath = C:\Oracle\product\19.3.0.0\client_64\bin
SelfTuning = 1
MaxStatementCacheSize = 100
DemandOraclePermission = 0
PerformanceCounters = 0
PromotableTransaction = promotable
StatementCacheWithUdts = 1
UdtCacheSize = 4096

SOFTWARE\ORACLE\ODP.NET.Managed

SOFTWARE\ORACLE\ODP.NET.Managed\4.122.19.1
TNS_ADMIN = C:\Oracle\product\19.3.0.0\client_32\network\admin

Let me know if you need anything else that would help diagnose this!!
-Benjamin
 
Back
Top