diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/bin/psql/startup.c | 33 |
1 files changed, 32 insertions, 1 deletions
diff --git a/src/bin/psql/startup.c b/src/bin/psql/startup.c index afee6d62a53..1aee5bc8a9a 100644 --- a/src/bin/psql/startup.c +++ b/src/bin/psql/startup.c @@ -3,7 +3,7 @@ * * Copyright (c) 2000-2003, PostgreSQL Global Development Group * - * $Header: /cvsroot/pgsql/src/bin/psql/startup.c,v 1.79 2003/08/07 21:11:58 tgl Exp $ + * $Header: /cvsroot/pgsql/src/bin/psql/startup.c,v 1.80 2003/09/29 18:21:33 momjian Exp $ */ #include "postgres_fe.h" @@ -80,6 +80,10 @@ static void showVersion(void); static void printSSLInfo(void); #endif +#ifdef WIN32 +static void + checkWin32Codepage(void); +#endif /* * @@ -270,6 +274,9 @@ main(int argc, char *argv[]) #ifdef USE_SSL printSSLInfo(); #endif +#ifdef WIN32 + checkWin32Codepage(); +#endif } /* Default values for variables that are used in interactive case */ @@ -621,3 +628,27 @@ printSSLInfo(void) } #endif + + + +/* + * checkWin32Codepage + * + * Prints a warning when win32 console codepage differs from Windows codepage + */ +#ifdef WIN32 +static void +checkWin32Codepage(void) +{ + unsigned int wincp, concp; + + wincp = GetACP(); + concp = GetConsoleCP(); + if (wincp != concp) { + printf("Warning: Console codepage (%u) differs from windows codepage (%u)\n" + " 8-bit characters will not work correctly. See PostgreSQL\n" + " documentation \"Installation on Windows\" for details.\n\n", + concp, wincp); + } +} +#endif |