Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TNhHg-0001fK-Ka for pgsql-bugs@postgresql.org; Mon, 15 Oct 2012 09:48:28 +0000 Received: from mail-qa0-f53.google.com ([209.85.216.53]) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TNhHa-0007Ww-Ew for pgsql-bugs@postgresql.org; Mon, 15 Oct 2012 09:48:26 +0000 Received: by mail-qa0-f53.google.com with SMTP id s11so1086940qaa.19 for ; Mon, 15 Oct 2012 02:48:21 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent :x-gm-message-state; bh=I0vUqfGG43Vs0x5jQaZvdxQ6Nv7yMssT4L1Nai+ugrc=; b=jgiPWpbK1KN/ZRljl3CTGkQbvGOCWr+GNbSXYlOCKooY7yRIm2E89jsWFuY8CETjcM CtNoxpHrH9ZYwt1oQ/nkJdgYFaIzbQjIj/GvtE16scd8tkM2sRjimg5OgQMZnhFHuBMZ Y629PdOBZSUt9700I9s9nbN7dyS0EColIqqBS+N2QbwPrIMBnsvURynne+fxU4WjTqen 9Q+oZ2AY6lDPI+RkB3CORTCPPGmUFdpLREJ41v4cbrdo1dXYeIJKNbm2sQxKa2BOpSZ5 dP0+flfG7GzUG69In7gsvwqmbhyHAThu/73xha57JWciSBNCYA47EkXaQTsP+WAwS0lo mUEA== Received: by 10.224.78.141 with SMTP id l13mr19285483qak.25.1350294501433; Mon, 15 Oct 2012 02:48:21 -0700 (PDT) Received: from tornado.leadboat.com (ip68-105-236-221.hr.hr.cox.net. [68.105.236.221]) by mx.google.com with ESMTPS id of5sm13766009qeb.10.2012.10.15.02.48.20 (version=SSLv3 cipher=OTHER); Mon, 15 Oct 2012 02:48:20 -0700 (PDT) Date: Mon, 15 Oct 2012 05:48:18 -0400 From: Noah Misch To: Tom Lane Cc: Alexander Law , Alvaro Herrera , Pg Bugs Subject: Re: BUG #6510: A simple prompt is displayed using wrong charset Message-ID: <20121015094818.GB4627@tornado.leadboat.com> References: <1331925178-sup-9261@alvh.no-ip.org> <4F65A533.7090208@gmail.com> <1332187409-sup-4631@alvh.no-ip.org> <4F68DF76.1030609@gmail.com> <20121010110555.GA21405@tornado.leadboat.com> <507A5D18.3080107@gmail.com> <26179.1350231042@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <26179.1350231042@sss.pgh.pa.us> User-Agent: Mutt/1.5.18 (2008-05-17) X-Gm-Message-State: ALoCoQm6yCT46imUByMzjqkzeyhtbBdhDCdxkot8DAMoHNcZTXE9T5p5o2yPZAXXajsxEnUGWKCb X-Pg-Spam-Score: -2.6 (--) X-Archive-Number: 201210/134 X-Sequence-Number: 34434 On Sun, Oct 14, 2012 at 12:10:42PM -0400, Tom Lane wrote: > Alexander Law writes: > > > +#ifdef WIN32 > > + termin = fopen("CONIN$", "r"); > > + termout = fopen("CONOUT$", "w+"); > > +#else > > termin = fopen(DEVTTY, "r"); > > termout = fopen(DEVTTY, "w"); > > +#endif > > if (!termin || !termout > > My immediate reaction to this patch is "that's a horrible kluge, why > shouldn't we change the definition of DEVTTY instead?" You could make DEVTTY_IN, DEVTTY_IN_MODE, DEVTTY_OUT and DEVTTY_OUT_MODE to capture all the differences. That doesn't strike me as an improvement, and no other function would use them at present. As I explained in my reply to Alexander, we should instead remove DEVTTY. > Is there a > similar issue in other places where we use DEVTTY? Yes. However, the other use of DEVTTY arises only with readline support, not typical of native Windows builds. > Also, why did you change the termout output mode, is that important > or just randomness? It's essential: http://archives.postgresql.org/message-id/20121010110555.GA21405@tornado.leadboat.com nm