views:

79

answers:

2

Hi,

I need to write a plsql function that will take a varchar2 column containing Polish national characters to escaped UTF-8, which will be then used in javascript,

So I need to convert:

zażółć gęślą jaźń

to:

za\u017c\u00f3\u0142\u0107 g\u0119\u015bl\u0105 ja\u017a\u0144

To be exact, my goal is to build a json encoder directly in oracle. This function will be important part of it.

Thanks for all answers :)

A: 

Have you tried using the built in function "ASCIISTR"?

Todd Pierce
A: 

Firstly, check out PL/JSON

Secondly, as I understand it, if the database characterset is Polish but the client connects using a UTF-8 characterset, then the conversion will be done for you. As far as Oracle is concerned, VARCHAR2 is a character string not a set of bytes.

Also read the Globabisation Guide for 9i.

Gary
Thank you for pointing me to PL/JSON. It seems to do the work for me.
SWilk