Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bPl5M-0001Gk-6V for pgsql-translators@arkaria.postgresql.org; Wed, 20 Jul 2016 06:34:24 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1bPl5K-0005Mb-Bf for pgsql-translators@arkaria.postgresql.org; Wed, 20 Jul 2016 06:34:22 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1bPl5I-0005MS-Tv for pgsql-translators@postgresql.org; Wed, 20 Jul 2016 06:34:21 +0000 Received: from mail-lf0-x22d.google.com ([2a00:1450:4010:c07::22d]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84_2) (envelope-from ) id 1bPl5F-0006K0-4T for pgsql-translators@postgresql.org; Wed, 20 Jul 2016 06:34:20 +0000 Received: by mail-lf0-x22d.google.com with SMTP id b199so30475043lfe.0 for ; Tue, 19 Jul 2016 23:34:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:to:references:cc:from:message-id:date:user-agent :mime-version:in-reply-to; bh=whpubb+XZeBO07JuGLAm3Sbvwv8baDosKRlsuwAUxOs=; b=wGNeA26EhycR551TyMEevDo92QeeY5+wLL0PgCZsXMrhGQLXG5PJibL5Ex3zCgP/u2 IIOUKwcEStdd46Qn1otNEl4Ot3HSqc1rNhy68puDAOI9Id5WBz4nk2YrUXC25hvxTxnU KFKxecUHn68/wYNyrBSwFt5HWhMI5OGmwqm6eq6WXwT+x+5wJDn3MZm0Hm+Zf9ZSq04r 8iEGHrBA1vksHo7lbbQV+axqep2gOIiSQ1PrwZPQbW/MdhvKAtl7N4ALU675SyCuxpGy hAczCy7KZ/MDdgFFfNhhhsnX2racSBb228yeOlx81dw81nJ40TOw8wUM2lP+1CUwcGfi rZrQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:cc:from:message-id:date :user-agent:mime-version:in-reply-to; bh=whpubb+XZeBO07JuGLAm3Sbvwv8baDosKRlsuwAUxOs=; b=cGsN2xYDKIsDA9XKHobxG6MWJmStok4jHdd607r82ebSNGrgVUzwdMiRGb28RLqCvi CEWPWOhQTVXT4Ox9qLdYJOaPLZNx+PvY5rfqkePiQLeRsUXBOQj7gb2rEVLDsG+k80KG Py+OpM55Smjr6kqXPjvr4YKoLKj3+2zDA60wUzL6CY6hmPJPqztd/ssV/Pxc7E0soTTZ K/9noGWVHCH6M2EL5IEDnUT/BtjZd3jiJF7aJesbIvIwes2CeI2zV7mN242NN0BhhoKM F9xzI5vRM+aIY3vgrP9Vk6rpK0qpkeLjC3rVpWxOp6rw5kMRuy4flc2bbZhNPG3LDFLo tc8Q== X-Gm-Message-State: ALyK8tKo5AqNCasuvVf1dORPwJhk83is2XwDjTKl/Mp+0UAGuVtU5X8jfIRRQ4/hCxuMAw== X-Received: by 10.25.159.17 with SMTP id i17mr5582934lfe.42.1468996454305; Tue, 19 Jul 2016 23:34:14 -0700 (PDT) Received: from [1.0.0.7] ([109.196.196.52]) by smtp.gmail.com with ESMTPSA id 21sm230931ljf.7.2016.07.19.23.34.13 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 19 Jul 2016 23:34:13 -0700 (PDT) Subject: Re: Problem with error messages To: Peter Eisentraut , pgsql-translators@postgresql.org References: <337ce77f-4159-0f43-cdb7-fcac30e3e219@2ndquadrant.com> Cc: Walter Willmertinger From: Alexander Law Message-ID: <578F1B63.5000301@gmail.com> Date: Wed, 20 Jul 2016 09:34:11 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.8.0 MIME-Version: 1.0 In-Reply-To: <337ce77f-4159-0f43-cdb7-fcac30e3e219@2ndquadrant.com> Content-Type: multipart/alternative; boundary="------------060702090500010008030608" X-Pg-Spam-Score: -2.7 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-translators Precedence: bulk Sender: pgsql-translators-owner@postgresql.org This is a multi-part message in MIME format. --------------060702090500010008030608 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Hello, I think, we had two issues here: 1. We have UTF-encoded translation to some language, which could contain extended (non-letter) characters such as », — , … and we have localized clients expecting to read the server messages in their language using non-UTF-encoding. I think we shouldn't leave them with the untranslated messages, instead we just should TRANSLIT option of iconv. For example: >echo 'HINWEIS: Tabelle »mickeymouse« existiert nicht, wird übersprungen' | iconv -f UTF-8 -t ASCII HINWEIS: Tabelle iconv: illegal input sequence at position 17 But >echo 'HINWEIS: Tabelle »mickeymouse« existiert nicht, wird übersprungen' | iconv -f UTF-8 -t ASCII//TRANSLIT HINWEIS: Tabelle >>mickeymouse<< existiert nicht, wird ubersprungen Is much better and still better than to show untranslated message with the notice about failed conversion. 2. Language of the localization could be not compatible with the client encoding at all. For example, we can't convert Russian to LATIN1 with TRANSLIT. In that case I would just print the original error message. Best regards, Alexander 20.07.2016 03:58, Peter Eisentraut пишет: > I finally had a moment to think this through. > > The problem is that if an error message is not representable in the > client encoding, all you get as a client are encoding errors. This can > happen in any translation (or untranslated, except those generally only > have ASCII characters). > > In this particular case, the German translated error messages contain > Unicode characters not in LATIN1/LATIN9. This might have been a bad > choice in retrospect, and can be fixed. But this same thing might also > happen if you happen to connect to a, say, a database with locale > ru_RU.utf8 while your client encoding is LATIN9. You will not be able > to get any error message other than an encoding error. (Ironically, the > backend will first try to send the encoding error in translated form, > which will again fail, and finally it will send it in English.) > > I think the recovery path should be changed so that it sends the > original error message in untranslated form, possibly preceded by a > notice that encoding conversion failed. > > Comments? > > > On 6/30/15 9:31 AM, Walter Willmertinger wrote: >> We already wrote in pgsql-bugs (#11550), but there it was recommended to >> transfer this topic to the translator team. >> >> Now the problem: >> If we set client_encoding to Latin9 (as we are here in Germany), we get >> as nearly every error message from PostgreSQL: character with byte >> sequence 0xe2 0x80 0x9e in encoding UTF8 has no >> equivalent in LATIN9 >> >> Why: >> In 9.x we have new characters for delimiting words. >> >> An example: >> "Drop table if exists mickeymouse;" >> delivers in PG-8.4 >> >> HINWEIS: Tabelle „mickeymouse“ existiert nicht, wird übersprungen >> >> but delivers in PG-9.3 >> >> HINWEIS: Tabelle »mickeymouse« existiert nicht, wird übersprungen >> >> If we set client_encoding to Latin9 (as we are here in Germany), we get >> an error message from PostgreSQL: >> character with byte sequence 0xe2 0x80 0x9e in encoding UTF8 has no >> equivalent in LATIN9 >> >> but we do not see the real error message: "Table ... does not exist" >> >> So a proposal: Please change these delimiters to something which can be >> compiled to any foreign language, as " or similar >> >> Regards >> Walter >> >> >> -- >> >> Viele Grüße >> >> Walter Willmertinger >> > --------------060702090500010008030608 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 8bit
Hello,

I think, we had two issues here:
1. We have UTF-encoded translation to some language, which could contain extended (non-letter) characters such as », — , …
and we have localized clients expecting to read the server messages in their language using non-UTF-encoding.
I think we shouldn't leave them with the untranslated messages, instead we just should TRANSLIT option of iconv.
For example:
>echo 'HINWEIS: Tabelle »mickeymouse« existiert nicht, wird übersprungen' | iconv -f UTF-8 -t ASCII
HINWEIS: Tabelle iconv: illegal input sequence at position 17
But
>echo 'HINWEIS: Tabelle »mickeymouse« existiert nicht, wird übersprungen' | iconv -f UTF-8 -t ASCII//TRANSLIT
HINWEIS: Tabelle >>mickeymouse<< existiert nicht, wird ubersprungen
Is much better and still better than to show untranslated message with the notice about failed conversion.

2. Language of the localization could be not compatible with the client encoding at all. For example, we can't convert Russian to LATIN1 with TRANSLIT. In that case I would just print the original error message.

Best regards,
Alexander


20.07.2016 03:58, Peter Eisentraut пишет:
I finally had a moment to think this through.

The problem is that if an error message is not representable in the
client encoding, all you get as a client are encoding errors.  This can
happen in any translation (or untranslated, except those generally only
have ASCII characters).

In this particular case, the German translated error messages contain
Unicode characters not in LATIN1/LATIN9.  This might have been a bad
choice in retrospect, and can be fixed.  But this same thing might also
happen if you happen to connect to a, say, a database with locale
ru_RU.utf8 while your client encoding is LATIN9.  You will not be able
to get any error message other than an encoding error.  (Ironically, the
backend will first try to send the encoding error in translated form,
which will again fail, and finally it will send it in English.)

I think the recovery path should be changed so that it sends the
original error message in untranslated form, possibly preceded by a
notice that encoding conversion failed.

Comments?


On 6/30/15 9:31 AM, Walter Willmertinger wrote:
We already wrote in pgsql-bugs (#11550), but there it was recommended to
transfer this topic to the translator team.

Now the problem:
If we set client_encoding to Latin9 (as we are here in Germany), we get
as nearly every error message from PostgreSQL: character with byte
sequence 0xe2 0x80 0x9e in encoding UTF8 has no
equivalent in LATIN9

Why:
In 9.x we have new characters for delimiting words.

An example:
"Drop table if exists mickeymouse;"
delivers in PG-8.4 

HINWEIS: Tabelle „mickeymouse“ existiert nicht, wird übersprungen

but delivers in PG-9.3

HINWEIS: Tabelle »mickeymouse« existiert nicht, wird übersprungen

If we set client_encoding to Latin9 (as we are here in Germany), we get
an error message from PostgreSQL:
character with byte sequence 0xe2 0x80 0x9e in encoding UTF8 has no
equivalent in LATIN9

but we do not see the real error message: "Table ... does not exist"

So a proposal: Please change these delimiters to something which can be
compiled to any foreign language, as "  or similar

Regards
Walter


-- 

Viele Grüße

Walter Willmertinger



--------------060702090500010008030608--