Use the dump
function to see how Oracle stores data internally.
You seem to have a misunderstanding on how Oracle treats VARCHAR2
characters set conversions: you can't influence how Oracle stores its data physically. (Also if you haven't already, it's helpful to read: The Absolute Minimum Every Software Developer Absolutely, Positively Must Know About Unicode and Character Sets).
Your client speaks to Oracle only in binary. In fact all systems exchange information in binary only. To understand each others, it is necessary that both systems know what language (character set) is being used.
In your case we can reconstruct what happens:
- Your client sends the byte
dd
to Oracle and says it iswindows-1252
(instead of1254)
. - Oracle looks up its character set table and sees that this data is translated to the symbol
Ý
in this character set. - Oracle logically stores this information in its table.
Since Oracle is setup in
UTF-8
, it converts this data to theUTF-8
binary reprensentation ofÝ
:SQL> SELECT rawtohex('Ý') FROM dual; RAWTOHEX('Ý') -------------- C39D
Oracle stores
C39D
internally.
As you can see, the problem comes from the first step: there is a problem of setup. As long as you don't fix this, the systems won't be able to successfully dialogue.
The conversion is automatic when you use VARCHAR2
because this datatype is a logical text symbol interface (you have next to no control over forcing the actual binary data being stored).