Re: XML only working in UTF-8 - Re: 8.4 open items list

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: pgsql-hackers(at)postgresql(dot)org, Chris Browne <cbbrowne(at)acm(dot)org>, Josh Berkus <josh(at)agliodbs(dot)com>
Subject: Re: XML only working in UTF-8 - Re: 8.4 open items list
Date: 2009-04-05 23:15:50
Message-ID: 4110.1238973350@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Peter Eisentraut <peter_e(at)gmx(dot)net> writes:
> On Sunday 05 April 2009 05:00:04 Tom Lane wrote:
>> Is there a reason not to fix it as suggested at
>> http://archives.postgresql.org/pgsql-bugs/2009-02/msg00032.php
>> ie recode on-the-fly from database encoding to UTF8?

> Probably just verifying that it works.

I studied this patch a bit and I'm unimpressed. It looks to me like
xml.c is absolutely chock-full of places where we pass DB-encoding
data to libxml, or vice versa. The patch only fixes a few of them,
and does so in a fairly ugly, ad-hoc fashion with lots of duplicated
code.

As near as I can tell, every place where you see an explicit cast
between char * and xmlChar * is probably broken. I think we ought
to approach this by refactoring to have all those conversions go
through subroutines, instead of blithely casting.

This is more work than I personally care to put into xml.c. Any
takers?

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2009-04-05 23:25:07 Re: Python 3.0 does not work with PL/Python
Previous Message James Pye 2009-04-05 23:10:59 Re: Python 3.0 does not work with PL/Python