wood burning stoves 2.0*
The moose likes XML and Related Technologies and the fly likes How to convert CLOB to UTF8 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "How to convert CLOB to UTF8" Watch "How to convert CLOB to UTF8" New topic
Author

How to convert CLOB to UTF8

Nagarajan Lakshamanan
Greenhorn

Joined: Sep 19, 2010
Posts: 8
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



Any thoughts on how to convert this CLOB to UTF8?

Regards,
NaG
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18541
    
    8

Why not use getCharacterStream, then? It doesn't convert the CLOB to bytes like getAsciiStream does, it gives you a Reader.
 
jQuery in Action, 2nd edition
 
subject: How to convert CLOB to UTF8
 
Similar Threads
conversion between CLOB/BLOB and String
How to convert CLOB to UTF8 stream in java.
unicode value for char
Understanding Byte Data and Character Encoding
XMLType in oracle procedure