Received: from makus.postgresql.org (makus.postgresql.org [98.129.198.125]) by mail.postgresql.org (Postfix) with ESMTP id 00A65C7DB12 for ; Mon, 19 Mar 2012 17:05:51 -0300 (ADT) Received: from 30.55.colo.spiretech.net ([69.168.55.30] helo=lists.commandprompt.com) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1S9ipy-0006uY-J2 for pgsql-bugs@postgresql.org; Mon, 19 Mar 2012 20:05:51 +0000 Received: from perhan.alvh.no-ip.org (spinlock.commandprompt.com [69.168.55.30]) by lists.commandprompt.com (Postfix) with ESMTPA id 10E92EB; Mon, 19 Mar 2012 13:06:26 -0700 (PDT) Received: from perhan.alvh.no-ip.org ([200.126.81.219] helo=perhan.alvh.no-ip.org) by assp.commandprompt.com with ESMTPS(AES256-SHA) (2.1.1); 19 Mar 2012 13:06:24 -0700 Received: by perhan.alvh.no-ip.org (Postfix, from userid 1000) id AEE5E6E306; Mon, 19 Mar 2012 17:05:33 -0300 (CLST) Content-Type: text/plain; charset=UTF-8 Cc: Pg Bugs Subject: Re: BUG #6510: A simple prompt is displayed using wrong charset From: Alvaro Herrera To: Alexander LAW In-reply-to: <4F65A533.7090208@gmail.com> References: <1331925178-sup-9261@alvh.no-ip.org> <4F65A533.7090208@gmail.com> Date: Mon, 19 Mar 2012 17:05:33 -0300 Message-Id: <1332187409-sup-4631@alvh.no-ip.org> User-Agent: Sup/git X-Assp-Version: 2.1.1(11364) on assp.commandprompt.com X-Assp-Client-TLS: yes X-Assp-ID: assp.commandprompt.com m1-87586-03416 X-Assp-Envelope-From: alvherre@alvh.no-ip.org X-Assp-Intended-For: exclusion@gmail.com X-Assp-Original-Subject: Re: [BUGS] BUG #6510: A simple prompt is displayed using wrong charset Content-Transfer-Encoding: quoted-printable X-Pg-Spam-Score: -1.9 (-) X-Archive-Number: 201203/143 X-Sequence-Number: 32704 Excerpts from Alexander LAW's message of dom mar 18 06:04:51 -0300 2012: > I see two ways to resolve the issue. > First is to use CharToOemBuff when writing a string to the "con" and=20 > OemToCharBuff when reading an input from it. > The other is to always use stderr/stdin for Win32 as it was done for=20 > msys before. I think it's more straightforward. Using console directly instead of stdin/out/err is more appropriate when asking for passwords and reading them back, because you can redirect the rest of the output to/from files or pipes, without the prompt interfering with that. This also explains why stderr is used instead of stdout. --=20 =C3=81lvaro Herrera The PostgreSQL Company - Command Prompt, Inc. PostgreSQL Replication, Consulting, Custom Development, 24x7 support