Re: Windows locale cause server to send invalid data encoding to client - Mailing list pgsql-bugs

From Tom Lane
Subject Re: Windows locale cause server to send invalid data encoding to client
Date
Msg-id 3484083.1626272399@sss.pgh.pa.us
Whole thread Raw
In response to Re: Windows locale cause server to send invalid data encoding to client  (Julien Rouhaud <rjuju123@gmail.com>)
List pgsql-bugs
Julien Rouhaud <rjuju123@gmail.com> writes:
> On Wed, Jul 14, 2021 at 01:49:24PM +0200, Antoine wrote:
>> I set up a postgresql server on Windows 10 and connected it using Rust, but
>> the Rust client reports invalid UTF-8 data when the password is wrong. I
>> use a french locale windows that contain some accents "éèê" etc.

> This is unfortunately working as designed.  The client encoding can't be set
> during startup (and authentication is part of it), see
> https://github.com/postgres/postgres/blob/master/src/backend/utils/mb/mbutils.c#L85-L88
> for more details about it:

It seems like the core problem is that the "authentication failed" error
text may be sent in an unexpected encoding.  I wonder if we should decline
to translate any error messages until we've established the requested
client encoding.  Sending the message in English isn't ideal either,
but it'd avoid this hazard.

            regards, tom lane



pgsql-bugs by date:

Previous
From: Julien Rouhaud
Date:
Subject: Re: Windows locale cause server to send invalid data encoding to client
Next
From: Pawel Kudzia
Date:
Subject: Re: IRe: BUG #16792: silent corruption of GIN index resulting in SELECTs returning non-matching rows