pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Matthias Apitz <guru@unixarea.de>
To: Celso Lorenzetti <celso@sysrs.com.br>
Cc: pgsql-general@lists.postgresql.org
Subject: Re: print formated special characteres
Date: Sat, 17 Oct 2020 20:51:36 +0200
Message-ID: <20201017185136.GA11747@c720-r342378> (raw)
In-Reply-To: <!&!AAAAAAAAAAAYAAAAAAAAAGBFA8ifz6xFmE1BXn1p/rXCgAAAEAAAAKNE3Hdr+WdOlJXZJZUQvU8BAAAAAA==@sysrs.com.br>
References: <!&!AAAAAAAAAAAYAAAAAAAAAGBFA8ifz6xFmE1BXn1p/rXCgAAAEAAAAKNE3Hdr+WdOlJXZJZUQvU8BAAAAAA==@sysrs.com.br>

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)





view thread (5+ messages)  latest in thread

Message-ID: <20201017185136.GA11747@c720-r342378>
Permalink:  ../20201017185136.GA11747@c720-r342378/
Also on:    postgresql.org/message-id/20201017185136.GA11747@c720-r342378

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: guru@unixarea.de, celso@sysrs.com.br
  Subject: Re: print formated special characteres
  In-Reply-To: <20201017185136.GA11747@c720-r342378>
  References: <!&!AAAAAAAAAAAYAAAAAAAAAGBFA8ifz6xFmE1BXn1p/rXCgAAAEAAAAKNE3Hdr+WdOlJXZJZUQvU8BAAAAAA==@sysrs.com.br> <20201017185136.GA11747@c720-r342378>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox