Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: How to add encoding attribute to prolog in XML-file

Re: How to add encoding attribute to prolog in XML-file

From: Maxim Demenko <mdemenko_at_arcor.de>
Date: Fri, 08 Sep 2006 17:15:54 +0200
Message-ID: <4501894d$0$17394$9b4e6d93@newsspool2.arcor-online.net>


willy schrieb:
> Dear Maxim,
> Thanks for your suggestion. I modified the script and the prolog
> including the attribute was added. However, I want to create an XML
> file based upon the query using UTL_FILE.
> I added code to the script to achieve this and to my surprise the value
> in the encoding attribute is modified automatically into US-ASCII
> When I run only the select statement, the output does contain the
> correct value for the encoding attribute!
> When I remove the encoding attribute from the xml-prolog in the select
> statement, the output file also contains an encoding attribute: again
> the value is US-ASCII.
>
> Kind regards,
>
> Willy Tadema

As you have seen in the forum topic i was referred to, encoding will be automatically converted to the client encoding. In case of utl_file it will be probably database character set ( i didn't test it myself). If you would need have encoding (for example ISO-8859-1) different from your database character set (for example AL32UTF8) , you could do something like this ( found on the OTN Forum as well - http://forums.oracle.com/forums/thread.jspa?messageID=1372277&#1372277)

v_blob := v_xml.getblobval(nls_charset_id('WE8ISO8859P1'));

However, the ISO-8955-1 is not a supported characterset in Oracle (i think so, at least, i could not find it as supported characterset either in documentation or Metalink), so i'm afraid, you can't get your xml in this encoding by means of oracle.

Best regards

Maxim Received on Fri Sep 08 2006 - 10:15:54 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US