Skip to Main Content

Oracle Database Discussions

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Problem with correct encoding - special characters

User_3DDU8Jan 25 2016 — edited Jan 26 2016

Hi Experts,

We have to export a report from an Oracle database which has some fields turned into binary.  The logic for these fields is as stated by the client: value -> convert to hexadecimal -> convert to binary.

The formula we arrived at seems to be working fine:

UTL_RAW.CAST_TO_VARCHAR2(TRIM(TO_CHAR(P_VAL,

                                                   'XXXXXXXXXXXXXXX')))

I have noticed that the value for 0152 returned by this formula is the sign ˜.  This is presented in PL/SQL correctly when running a simple select query.  This is also present in the customer original file, but the output file we are generating shows us this symbol: �

I am using Notepad++ plus a Hex plugin to see these files.  When looking at the correct file with the hex mode, I see the hex value set to 00 98.  But our output file is having so different values as we test different things, none giving us the expected ˜ or 00 98 (hex value).


What could we be doing wrong?  Any ideas? Database is version 11.2

Thanks in advance.

Rafa

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 23 2016
Added on Jan 25 2016
8 comments
3,456 views