Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kTrJ7-00074z-LE for pgsql-general@arkaria.postgresql.org; Sat, 17 Oct 2020 18:51:57 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kTrJ6-0002cf-1P for pgsql-general@arkaria.postgresql.org; Sat, 17 Oct 2020 18:51:56 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kTrJ5-0002bV-QW for pgsql-general@lists.postgresql.org; Sat, 17 Oct 2020 18:51:55 +0000 Received: from ms-10.1blu.de ([178.254.4.101]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kTrIz-0001yk-AM for pgsql-general@lists.postgresql.org; Sat, 17 Oct 2020 18:51:54 +0000 Received: from [80.187.82.78] (helo=localhost.unixarea.de) by ms-10.1blu.de with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kTrIu-00066x-Gy; Sat, 17 Oct 2020 20:51:44 +0200 Received: from localhost.my.domain (localhost [127.0.0.1]) by localhost.unixarea.de (8.15.2/8.14.9) with ESMTPS id 09HIpd4b011781 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Sat, 17 Oct 2020 20:51:39 +0200 (CEST) (envelope-from guru@unixarea.de) Received: (from guru@localhost) by localhost.my.domain (8.15.2/8.14.9/Submit) id 09HIpah4011780; Sat, 17 Oct 2020 20:51:36 +0200 (CEST) (envelope-from guru@unixarea.de) X-Authentication-Warning: localhost.my.domain: guru set sender to guru@unixarea.de using -f Date: Sat, 17 Oct 2020 20:51:36 +0200 From: Matthias Apitz To: Celso Lorenzetti Cc: pgsql-general@lists.postgresql.org Subject: Re: print formated special characteres Message-ID: <20201017185136.GA11747@c720-r342378> Reply-To: Matthias Apitz References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Operating-System: FreeBSD 13.0-CURRENT r342378 (amd64) X-message-flag: Mails containing HTML will not be read! Please send only plain text. User-Agent: Mutt/1.11.1 (2018-12-01) X-Con-Id: 51246 X-Con-U: 0-guru X-Originating-IP: 80.187.82.78 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk 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)