The following bug has been logged on the website: Bug reference: 6510 Logged by: Alexander LAW Email address: exclus...@gmail.com PostgreSQL version: 9.1.3 Operating system: Windows Description:
I'm using postgresSQL in Windows with Russian locale and get unreadable messages when the postgres utilities prompting me for input. Please look at the screenshot: http://oi44.tinypic.com/aotje8.jpg (The psql writes the unreadable message prompting for the password.) But at the same time the following message (WARINING) displayed right. I believe it's related to setlocale and the difference between OEM and ANSI encoding, which we had in Windows with the Russian locale. The startup code of psql sets locale with the call setlocale(LC_ALL, "") and MSDN documentation says that the call: Sets the locale to the default, which is the user-default ANSI code page obtained from the operating system. After the call all the strings printed with the printf(stdout) will go through the ANSI->OEM conversion. But in the simple_prompt function strings written to con, and such writes go without conversion. I've made a little test to illustrate this: #include "stdafx.h" #include <locale.h> int _tmain(int argc, _TCHAR* argv[]) { printf("ОК\n"); setlocale(0, ""); fprintf(stdout, "ОК\n"); FILE * termin = fopen("con", "w"); fprintf(termin, "ОК\n"); fflush(termin); return 0; } where "ОК" is "OK" with russian letters. This test gives the following result: http://oi39.tinypic.com/35jgljs.jpg The second line is readable, while the others are not. If it can be helpful to understand the issue, I can perform another tests. Thanks in advance, Alexander -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs