Skip to Main Content

Database Software

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!

UTF8 conversion to AL16UTF16

806446Jun 25 2012 — edited Jun 25 2012
I'm working on a version 11.2 database with

NLS_CHARACTERSET = WE8MSWIN1252
and
NLS_NCHAR_CHARACTERSET = AL16UTF16

I've got some UFT8 characters being sent to the database as raw data. I need to be able to store this in a readable format and I think the only option is an NVarchar2 column.

I think the solution should include something like this:
      utl_raw.cast_to_nvarchar2(
      utl_raw.convert(
         r            => <raw data>,
         to_charset   => 'AL16UTF16',
         from_charset => 'UTF8'))
but that gives me an exception: ORA-06502: PL/SQL: numeric or value error


Also, am I right in thinking that any Varchar2 column in this database can only hold single-byte characters (from WE8MSWIN1252) even if the size is defined as "n char"?


I've not worked much with different character sets so any help would be appreciated. Thanks.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 23 2012
Added on Jun 25 2012
2 comments
1,807 views