Skip to Main Content

SQL & PL/SQL

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!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

PL/SQL unicode decoder

user11085282Jul 19 2012 — edited Jul 19 2012
Hello,

could you let me know if there is a function in PL/SQL to convert the unicode code to it's character, I have unicode code returned for example '%C3%A9' and would like the function to return 'é'.

Many thanks
Lukasz

Comments

chris227
Hi,

'%C3%A9' seems to be from a UTF-8 encoded URL.

Unicodepoint for é is \00E9.
select unistr('\00E9') from dual 

UNISTR('\00E9') 
é 
Saying this i should also hint to a possible solution ;-)
select UTL_URL.UNESCAPE ('%C3%A9', 'UTF-8') from dual 

UTL_URL.UNESCAPE('%C3%A9','UTF-8') 
é 
regards

Edited by: chris227 on 19.07.2012 08:26
odie_63
See UTL_URL package :
http://docs.oracle.com/cd/E11882_01/appdev.112/e25788/u_url.htm#i996904
SQL> select utl_url.unescape('%C3%A9','AL32UTF8') from dual;
 
UTL_URL.UNESCAPE('%C3%A9','AL3
--------------------------------------------------------------------------------
é
 
user11085282
Thanks a lot. So, is there a function that does the same what unistr does for an utf8?

Thanks
Lukasz
chris227
Yes see my post above.
Master odie did know it out of the box i guees, i had to search a little bit for it first ;-)
chris227
One question allowed?
Is there a difference in using 'AL32UTF8' to UTF-8?

Thanks
user11085282
Fantastic, you are great guys! Thank you so much.
odie_63
Hi Chris,
Is there a difference in using 'AL32UTF8' to UTF-8?
In this case there's no difference, both Oracle and IANA names can be used for the url_charset parameter (UTF-8 being the IANA name for Oracle's AL32UTF8).
1 - 7
Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Aug 16 2012
Added on Jul 19 2012
7 comments
1,328 views