开发者

Oracle 9i - Convert Varchar2 to javascript escaped UTF-8?

I need to write a plsql function that will take a varchar2 column containing Polish national characters to esc开发者_如何学运维aped 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 :)


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.


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜