Re: print formated special characteres

From: Matthias Apitz <guru(at)unixarea(dot)de>
To: Celso Lorenzetti <celso(at)sysrs(dot)com(dot)br>
Cc: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: print formated special characteres
Date: 2020-10-17 18:51:36
Message-ID: 20201017185136.GA11747@c720-r342378
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

El día sábado, octubre 17, 2020 a las 03:37:46p. m. -0300, Celso Lorenzetti escribió:

> Somebody help me, please.
>
> How to make the texts are aligned with 10 characters?
>
>
>
> elog(INFO, "\n%-10s Fim\n%-10s Fim\n", "Variável", "Variavel");

Hola Celso,

You can reproduce the same on the UNIX shell with:

$ printf "\n%-10s Fim\n%-10s Fim\n" "Variável" "Variavel"

Variável Fim
Variavel Fim

$ printf "\n%-10s Fim\n%-10s Fim\n" "VariXvel" "Variavel"

VariXvel Fim
Variavel Fim

The second test (changing the accented char 'á' by 'X'), shows that the
problem/bug is a) more generic, not only in PostgreSQL and b) has todo
with being the UTF-8 char 'á' a two byte char, while 'X' is only one
byte.

I have no solution, though at the moment...

Obrigado

matthias

--
Matthias Apitz, ✉ guru(at)unixarea(dot)de, http://www.unixarea.de/ +49-176-38902045
Public GnuPG key: http://www.unixarea.de/key.pub
Без книги нет знания, без знания нет коммунизма (Влaдимир Ильич Ленин)
Without books no knowledge - without knowledge no communism (Vladimir Ilyich Lenin)
Sin libros no hay saber - sin saber no hay comunismo. (Vladimir Ilich Lenin)

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Peter J. Holzer 2020-10-17 22:44:37 Re: print formated special characteres
Previous Message Celso Lorenzetti 2020-10-17 18:37:46 print formated special characteres