Re: print formated special characteres

Поиск
Список
Период
Сортировка
От Matthias Apitz
Тема Re: print formated special characteres
Дата
Msg-id 20201017185136.GA11747@c720-r342378
обсуждение исходный текст
Ответ на print formated special characteres  ("Celso Lorenzetti" <celso@sysrs.com.br>)
Ответы Re: print formated special characteres  ("Peter J. Holzer" <hjp-pgsql@hjp.at>)
Список 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@unixarea.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)



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

Предыдущее
От: "Celso Lorenzetti"
Дата:
Сообщение: print formated special characteres
Следующее
От: "Peter J. Holzer"
Дата:
Сообщение: Re: print formated special characteres