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!

What is the reverse of UNISTR?

Duncan GardnerAug 21 2012 — edited Aug 22 2012
How do I convert unicode characters into a unicode string? I thought it might be utl_raw.cast_to_raw, but that doesn't work consistently - I get a a six-character HEX string, expecting four for charcacers I enter via a SQL statement.

SELECT x, utl_raw.cast_to_raw(x), y, utl_raw.cast_to_raw(y)
FROM (SELECT UNISTR('\4E2D') as x, '中' AS y FROM DUAL);

results in:

"X" "UTL_RAW.CAST_TO_RAW(X)" "Y" "UTL_RAW.CAST_TO_RAW(Y)"
"中" "4E2D" "中" "E4B8AD"

My database is AL32UTF8. I'm using SQL Developer, with NLS_LANG set to ENGLISH_AUSTRALIA.AL32UTF8. My Windows 7 environment is English Australia.

I suspect it is some sort of client issue. Can I resolve this without changing my PC to the target language in it's entirety?
This post has been answered by Sergiusz Wolicki-Oracle on Aug 22 2012
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 19 2012
Added on Aug 21 2012
4 comments
6,039 views