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!

Convert NVARCHAR2 to UTF-8

DavidFaizJun 19 2016 — edited Jun 20 2016

Hello,

I have a database which stores usernames only in English at the moment. I would like to incorporate BASE64 & UTF-8 in order to store in other languages as well. The column type is NVARCHAR2.

The database procedure receives the name in BASE64, I'm decoding it via UTL_ENCODE.BASE64_DECODE & converting the string to VARCHAR2 using UTL_RAW.CAST_TO_VARCHAR2.

But I get gibberish back and not the actual word. For example I get 'алекс' as the name in BASE64. I'm able to decode it but the cast to VARCHAR2/NVARCHAR2 does not return the value only gibberish.

I see it stored as upside down question marks in the table and when SELECTing it, I get the same.

I'm running on Oracle 12c using NLS_CHARACTERSET WE8ISO8859P1

How can I overcome this?

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 18 2016
Added on Jun 19 2016
8 comments
2,165 views