Re: xml type and encodings - Mailing list pgsql-hackers

From Florian G. Pflug
Subject Re: xml type and encodings
Date
Msg-id 45ABC2E7.4070108@phlo.org
Whole thread Raw
In response to Re: xml type and encodings  (Peter Eisentraut <peter_e@gmx.net>)
Responses Re: xml type and encodings  (Peter Eisentraut <peter_e@gmx.net>)
List pgsql-hackers
Peter Eisentraut wrote:
> Am Montag, 15. Januar 2007 17:33 schrieb Florian G. Pflug:
>> Would this mean that if the client_encoding is for example latin1, and I
>> retrieve an xml document uploaded by a client with client_encoding utf-8
>> (and thus having encoding="c" in the xml tag), that I would get a
>> document with latin1 encoding but saying that it's utf-8 in it's xml tag?
> 
> That is likely to be a consequence of this proposed behaviour, but no doubt 
> not a nice one.

Couldn't the server change the encoding declaration inside the xml to 
the correct
one (the same as client_encoding) before returning the result?
Otherwise, parsing the xml on the client with some xml library becomes 
difficult, because the library is likely to get confused by the wrong 
encoding tag - and you can't even fix that by using the correct client
encoding, because you don't know what the encoding tag says until you 
have retrieved the document...

greetings, Florian Pflug



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Function execution costs 'n all that
Next
From: Magnus Hagander
Date:
Subject: Re: [GENERAL] Checkpoint request failed on version 8.2.1.