Skip site navigation (1) Skip section navigation (2)

Re: [PATCH] Formatting patch for psql

From: Martijn van Oosterhout <kleptog(at)svana(dot)org>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: pgsql-patches(at)postgresql(dot)org
Subject: Re: [PATCH] Formatting patch for psql
Date: 2005-11-24 22:57:07
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-patches
On Thu, Nov 24, 2005 at 11:35:11PM +0100, Peter Eisentraut wrote:
> Martijn van Oosterhout wrote:
> > On Thu, Nov 24, 2005 at 03:45:12PM +0100, Peter Eisentraut wrote:
> > > Shouldn't you use PQmblen() to determine whether an encoding is
> > > single-byte, rather than having an enumerated list?
> >
> > Actually, thinking about it the answer is no. The code is relying on
> > the fact that it's a charset that has ASCII as a subset.
> Which code does that?

Well, the code you're referring to: the two places where it enumerates
the encodings in my patch. That code basically understands \n as going
to the next line, but that's ASCII.

What I beleive you were suggesting was to replace the switch statement
with something like 

if(PQmblen(...) == 1) 
{ code for latin1 }
else if( encoding == UTF8 )
{ code for utf8 }

And what I'm saying is that you can only do that if all single byte
encodings are ASCII compatable and I'm not prepared to say that...

So in the switch statement I listed the encodings I know to be ASCII
compatable and at some point someone who actually knows the other
encodings will explain what needs to be done.

Hope this helps,
Martijn van Oosterhout   <kleptog(at)svana(dot)org>
> Patent. n. Genius is 5% inspiration and 95% perspiration. A patent is a
> tool for doing 5% of the work and then sitting around waiting for someone
> else to do the other 95% so you can sue them.

In response to


pgsql-patches by date

Next:From: Tom LaneDate: 2005-11-25 02:23:55
Subject: Re: [PATCH] Formatting patch for psql
Previous:From: Peter EisentrautDate: 2005-11-24 22:35:11
Subject: Re: [PATCH] Formatting patch for psql

Privacy Policy | About PostgreSQL
Copyright © 1996-2018 The PostgreSQL Global Development Group