Re: Unicode UTF-8 table formatting for psql text output

Поиск
Список
Период
Сортировка
От Roger Leigh
Тема Re: Unicode UTF-8 table formatting for psql text output
Дата
Msg-id 20091024172324.GB17870@codelibre.net
обсуждение исходный текст
Ответ на Re: Unicode UTF-8 table formatting for psql text output  (Peter Eisentraut <peter_e@gmx.net>)
Ответы Re: Unicode UTF-8 table formatting for psql text output
Список pgsql-hackers
On Fri, Oct 16, 2009 at 01:38:15PM +0300, Peter Eisentraut wrote:
> I like the new Unicode tables, but the marking of continuation lines
> looks pretty horrible:
>
>                              List of databases
>      Name      │ Owner │ Encoding │ Collation │ Ctype │ Access
> privileges
> ───────────────┼───────┼──────────┼───────────┼───────┼───────────────────
>  pl_regression │ peter │ LATIN2   │ cs_CZ     │ cs_CZ │
>  postgres      │ peter │ LATIN2   │ cs_CZ     │ cs_CZ │
>  template0     │ peter │ LATIN2   │ cs_CZ     │ cs_CZ │ =c/peter
>                ╷       ╷          ╷           ╷       ╎ peter=CTc/peter
>  template1     │ peter │ LATIN2   │ cs_CZ     │ cs_CZ │ =c/peter
>                ╷       ╷          ╷           ╷       ╎ peter=CTc/peter
> (4 rows)
>
> This looks more like a rendering mistake than something sensible, and
> also it doesn't actually help the viewer to tell what lines are
> continued, which was the original purpose.

I've worked on a solution to this, and the preliminary patch for this
is attached.  Note there are additional comments in the patch text.

This patch does break backward compatibility with older psql versions,
by using symbols in the column border to mark newlines and wrapped
lines rather than putting ':' and ';' and ' ' symbols in the vertical
table lines.  This makes things somewhat more consistent and readable
but at the expense of not perfectly preserving output.  The ASCII
rules are a little more compatible than the Unicode rules, but both
do break things a little.  If the data lines do not contain either
newlines or wrapped text, then the output will remain unchanged.

Any feedback would be appreciated.


Regards,
Roger

--
  .''`.  Roger Leigh
 : :' :  Debian GNU/Linux             http://people.debian.org/~rleigh/
 `. `'   Printing on GNU/Linux?       http://gutenprint.sourceforge.net/
   `-    GPG Public Key: 0x25BFB848   Please GPG sign your mail.

Вложения

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

Предыдущее
От: Simon Riggs
Дата:
Сообщение: Re: Parsing config files in a directory
Следующее
От: Greg Smith
Дата:
Сообщение: Re: Parsing config files in a directory