Re: [bug fix] multibyte messages are displayed incorrectly on the client

From: "MauMau" <maumau307(at)gmail(dot)com>
To: "MauMau" <maumau307(at)gmail(dot)com>, "Noah Misch" <noah(at)leadboat(dot)com>
Cc: <alvherre(at)2ndquadrant(dot)com>, "Bruce Momjian" <bruce(at)momjian(dot)us>, <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [bug fix] multibyte messages are displayed incorrectly on the client
Date: 2014-01-20 10:47:24
Message-ID: E90903BBCE674ABAAEF9862DA12BA6DE@maumau
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

From: "MauMau" <maumau307(at)gmail(dot)com>
> From: "Noah Misch" <noah(at)leadboat(dot)com>
>> I agree that English consistently beats mojibake. I question whether
>> that
>> makes up for the loss of translation when encodings do happen to match,
>> particularly for non-technical errors like a mistyped password. The
>> everything-UTF8 scenario appears often, perhaps explaining infrequent
>> complaints about the status quo. If 90% of translated message users have
>> client_encoding != server_encoding, then +1 for your patch's strategy.
>> If the
>> figure is only 60%, I'd vote for holding out for a more-extensive fix
>> that
>> allows us to encoding-convert localized authentication failure messages.
>
> I agree with you. It would be more friendly to users if more messages are
> localized.
>
> Then, as a happy medium, how about disabling message localization only if
> the client encoding differs from the server one? That is, compare the
> client_encoding value in the startup packet with the result of
> GetPlatformEncoding(). If they don't match, call
> disable_message_localization().

I did this with the attached patch. I added some code in
BackendInitialize(). I'll update the CommitFest entry in a few days.

Regards
MauMau

Attachment Content-Type Size
no_localize_message_in_startup_v2.patch application/octet-stream 6.2 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Albe Laurenz 2014-01-20 10:53:09 Re: Compiling extensions on Windows
Previous Message Andres Freund 2014-01-20 10:40:25 Re: [Lsf-pc] Re: Linux kernel impact on PostgreSQL performance (summary v2 2014-1-17)