Re: xml type and encodings

From: "Florian G(dot) Pflug" <fgp(at)phlo(dot)org>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: nikolay(at)samokhvalov(dot)com, pgsql-hackers(at)postgresql(dot)org
Subject: Re: xml type and encodings
Date: 2007-01-15 18:07:35
Message-ID: 45ABC2E7.4070108@phlo.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Alvaro Herrera 2007-01-15 18:12:39 Re: Autovacuum improvements
Previous Message Magnus Hagander 2007-01-15 18:07:29 Re: [HACKERS] Checkpoint request failed on version 8.2.1.