Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1ZfYlR-00013Q-6y for pgsql-bugs@arkaria.postgresql.org; Fri, 25 Sep 2015 19:34:37 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1ZfYlQ-0002yZ-Fq for pgsql-bugs@arkaria.postgresql.org; Fri, 25 Sep 2015 19:34:36 +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) (envelope-from ) id 1ZfYko-0002DI-DQ for pgsql-bugs@postgresql.org; Fri, 25 Sep 2015 19:33:58 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1ZfYkl-0006Qb-QC for pgsql-bugs@postgresql.org; Fri, 25 Sep 2015 19:33:57 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id t8PJXiaT018479; Fri, 25 Sep 2015 15:33:44 -0400 From: Tom Lane To: lei@aswsyst.cz cc: pgsql-bugs@postgresql.org Subject: Re: BUG #13638: Exception texts from plperl has bad encoding In-reply-to: <18105.1443208708@sss.pgh.pa.us> References: <20150925112345.26913.28407@wrigleys.postgresql.org> <18105.1443208708@sss.pgh.pa.us> Comments: In-reply-to Tom Lane message dated "Fri, 25 Sep 2015 15:18:28 -0400" Date: Fri, 25 Sep 2015 15:33:44 -0400 Message-ID: <18478.1443209624@sss.pgh.pa.us> X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org I wrote: > I suspect the root problem is that instead of baldly doing > croak("%s", edata->message); > in do_util_elog(), we need to do something to inform Perl what encoding > the message string is in. This is beyond my Perl-fu, however. BTW, if the answer to that involves turning the message back into an SV, I think we should not do that but just use the SV that was passed in originally. Then the TRY/CATCH could go away entirely, ie the code would become roughly like if (level < ERROR) { cmsg = sv2cstr(msg); elog(level, "%s", cmsg); pfree(cmsg); } else { croak-with-SV(msg); } which knows slightly more about the meaning of "level" than before, but otherwise seems much less entangled with anything. It's still beyond my Perl-fu ... regards, tom lane -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs