This discussion is archived
0 Replies Latest reply: Nov 8, 2012 7:18 AM by Naga_Lakshmanan RSS

How to convert CLOB to UTF8

Naga_Lakshmanan Newbie
Currently Being Moderated
Hi all,

We have batch job which actually runs on daily basis and produces XML with the Java code.And the XML generated is used for various purposes.
Recently the job was not executed successfully because of some special characters in XML which falls out of ANSI encoding stantands.

So we are in a situation to convert the CLOB datatype (input to Java code) to UTF8 encoded XML.
We are not to able to achieve this .

Right now the cloB data is converted to ASCII stream,which doesn't create a well formed XML based on UTF8 encoding standards.See below the code
clob xmlCLOB = (Clob)clobInfo.get("clobfield");
InputStream is = xmlCLOB.getAsciiStream();

Any thoughts on how to convert this CLOB to UTF8?

Regards,
NaG

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points