Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Outputting data in UTF-8
Jeremy wrote:
> We are sending XML to a 3rd party on request and this is being delivered
> from a 9iR2 database running on Solaris and using Oracle HTTP server and
> mod_plsql.
>
> The 3rd party has told us that the data should be in UTF-8 encoding
> instead of ISO-8859-1
>
> I had assumed (naively it appears) that simply setting the http headers
> and document declaration e.g.:
>
> owa_util.mime_header('text/xml; charset=UTF-8', false);
> owa_util.http_header_close;
> htp.p('<?xml version="1.0" encoding="UTF-8"?>');
>
>
> would be sufficient however when looking in e.g. firefox at the document
> details it still says that the encoidng is ISO-8859-1
You mean "page info, General, Meta data? If that says ISO-8859,
your UTF above is *not* used to generate the page you're looking
at.
Apart from that - do you *store* UTF data, or was your database
created with WE8ISO8859P1?
>
> So the question is: how can I generate the data using the requested
> encoding?
>
> Is there an 'alter session' directive I can use?
>
UTF is a multi byte character set (the 8 meaning, bytes are being used, not [16 or 32-bit] words), using up to 4 bytes per character. All Oracle Database character set, starting with WE8 are Western European, 8 bits (fixed!) charactersets.
And you could start by changing the client's character set to UTF8, by changing the NLS_LANG environment variable - it probably contains the ISO8859P1, too
-- Regards, Frank van BortelReceived on Thu Mar 17 2005 - 08:01:20 CST