Re: BUG #6510: A simple prompt is displayed using wrong charset

From: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
To: Alexander LAW <exclusion(at)gmail(dot)com>
Cc: Pg Bugs <pgsql-bugs(at)postgresql(dot)org>
Subject: Re: BUG #6510: A simple prompt is displayed using wrong charset
Date: 2012-03-19 20:05:33
Message-ID: 1332187409-sup-4631@alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-general pgsql-hackers


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
> OemToCharBuff when reading an input from it.
> The other is to always use stderr/stdin for Win32 as it was done for
> 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.

--
Álvaro Herrera <alvherre(at)commandprompt(dot)com>
The PostgreSQL Company - Command Prompt, Inc.
PostgreSQL Replication, Consulting, Custom Development, 24x7 support

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Alvaro Herrera 2012-03-19 20:40:37 Re: BUG #6511: calling spi_exec_query from non-main package, results in: couldn't fetch $_TD
Previous Message kebe.1969 2012-03-19 17:47:29 BUG #6543: pgadmin III - Error defining filter.

Browse pgsql-general by date

  From Date Subject
Next Message david.sahagian 2012-03-19 20:24:10 usage of pg_get_functiondef() -- SQL state 42809
Previous Message Lonni J Friedman 2012-03-19 19:38:11 Re: pg_upgrade + streaming replication ?

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Geoghegan 2012-03-19 20:48:07 Re: Re: pg_stat_statements normalisation without invasive changes to the parser (was: Next steps on pg_stat_statements normalisation)
Previous Message Alvaro Herrera 2012-03-19 20:01:37 Re: patch: autocomplete for functions