Re: [PATCH] Formatting patch for psql

Поиск
Список
Период
Сортировка
От Martijn van Oosterhout
Тема Re: [PATCH] Formatting patch for psql
Дата
Msg-id 20051124225705.GD29774@svana.org
обсуждение исходный текст
Ответ на Re: [PATCH] Formatting patch for psql  (Peter Eisentraut <peter_e@gmx.net>)
Ответы Re: [PATCH] Formatting patch for psql  (Tom Lane <tgl@sss.pgh.pa.us>)
Список 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 }
else
{etc}

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@svana.org>   http://svana.org/kleptog/
> 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.

Вложения

В списке pgsql-patches по дате отправления:

Предыдущее
От: Peter Eisentraut
Дата:
Сообщение: Re: [PATCH] Formatting patch for psql
Следующее
От: Tom Lane
Дата:
Сообщение: Re: [PATCH] Formatting patch for psql