Re: [GENERAL] psql weird behaviour with charset encodings - Mailing list pgsql-hackers

From hernan gonzalez
Subject Re: [GENERAL] psql weird behaviour with charset encodings
Date
Msg-id w2w48692c2d1005081008v485459f8he87460da7e1beaaf@mail.gmail.com
Whole thread Raw
In response to Re: [GENERAL] psql weird behaviour with charset encodings  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: [GENERAL] psql weird behaviour with charset encodings  (hgonzalez@gmail.com)
Re: [GENERAL] psql weird behaviour with charset encodings  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
Wow, you are right, this is bizarre...

And it's not that glibc intends to compute the length in unicode chars,
it actually counts bytes (c plain chars) -as it should- for computing
field widths...
But, for some strange reason, when there is some width calculation involved
it tries so parse the char[] using the locale encoding (when there's no point
in doing it!) and if it fails, it truncates (silently) the printf output.
So it seems more  a glib bug to me than an interpretion issue (bytes vs chars).
I posted some details in stackoverflow:
http://stackoverflow.com/questions/2792567/printf-field-width-bytes-or-chars

BTW, I understand that postgresql uses locale semantics in the server code.
But is this really necessary/appropiate in the client (psql) side?
Couldnt we stick
with C locale here?

--
Hernán J. González
http://hjg.com.ar/

pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: possible memory leak with SRFs
Next
From: Bruce Momjian
Date:
Subject: Re: max_standby_delay considered harmful