pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Sergey Burladyan <eshkinkot@gmail.com>
Cc: Peter Eisentraut <peter_e@gmx.net>
Cc: pgsql-bugs@postgresql.org
Subject: Re: BUG #6480: NLS text width problem
Date: Tue, 06 Mar 2012 19:49:28 -0500
Message-ID: <23924.1331081368@sss.pgh.pa.us> (raw)
In-Reply-To: <87hay1iksj.fsf@home.progtech.ru>
References: <E1RzxD1-0003Tf-1y@wrigleys.postgresql.org>
	<87obsq4sus.fsf@home.progtech.ru>
	<1330714739.11007.4.camel@vanquo.pezone.net>
	<87hay1iksj.fsf@home.progtech.ru>

Sergey Burladyan <eshkinkot@gmail.com> writes:
> Peter Eisentraut <peter_e@gmx.net> writes:
>> Can you prepare a patch?

> Surely, I was sent this patch to pgsql-hackers and added to the commitfest-next to
> be sure I'll never lost it https://commitfest.postgresql.org/action/patch_view?id=816

Hmm, this patch makes it obvious that the current incarnation of
pg_wcswidth has never worked.  Good thing it's been unused for the same
length of time :-(

> Unfortunately, I was sent it with content-disposition: inline by mistake, as
> result, web interface divided it by two independent parts. Also this patch for 9.1

I'm a bit nervous about the idea of back-patching this, as if there is
anything wrong with it it will break code that works perfectly fine for
most people.  Possibly more to the point, it is making assumptions about
the behavior of printf with %*s that I think are unportable.  Even
granted that libc is glibc, isn't this pretty much guaranteed to fail
if glibc's idea of the encoding is different from pset.encoding?

I think it'd be better to avoid depending on %*s for the data string
and instead use it (with appropriate adjustment of the calculation)
for the space-separator part of the format.  Since that's a constant
empty string, there shouldn't be any possibility of libc doing something
other than what we intend.

			regards, tom lane



view thread (8+ messages)  latest in thread

Message-ID: <23924.1331081368@sss.pgh.pa.us>
Permalink:  ../23924.1331081368@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/23924.1331081368@sss.pgh.pa.us

 · 

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-bugs@postgresql.org
  Cc: tgl@sss.pgh.pa.us, eshkinkot@gmail.com, peter_e@gmx.net
  Subject: Re: BUG #6480: NLS text width problem
  In-Reply-To: <23924.1331081368@sss.pgh.pa.us>
  References: <E1RzxD1-0003Tf-1y@wrigleys.postgresql.org> <87obsq4sus.fsf@home.progtech.ru> <1330714739.11007.4.camel@vanquo.pezone.net> <87hay1iksj.fsf@home.progtech.ru> <23924.1331081368@sss.pgh.pa.us>

* 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