aboutsummaryrefslogtreecommitdiff
path: root/src/bin/psql/input.c
diff options
context:
space:
mode:
authorBruce Momjian <bruce@momjian.us>2003-07-27 03:32:26 +0000
committerBruce Momjian <bruce@momjian.us>2003-07-27 03:32:26 +0000
commit9df48371c20869ac63a63b45550dbf4b045aa4bf (patch)
treed01352587f18c4d1ba7827295a5a9aa06ffe5feb /src/bin/psql/input.c
parente7fe89d57ddda6ad35c68bfcf1d78c2fe0caac4e (diff)
downloadpostgresql-9df48371c20869ac63a63b45550dbf4b045aa4bf.tar.gz
postgresql-9df48371c20869ac63a63b45550dbf4b045aa4bf.zip
here are the patches for psql on Win32:
psql4win32.patch - changes in the psql source code psql-ref.patch - changes in the documentation psql-ref.sgml (for new builtin variable WIN32_CONSOLE) To apply them use "patch -p 1" in the root directory of the postgres source directory. These patches fix the following problems of psql on Win32 (all changes only have effect #ifdef WIN32): a) Problem: Static library libpq.a did not work Solution: Added WSAStartup() in fe-connect.c b) Problem: Secret Password was echoed by psql Solution: Password echoing disabled in sprompt.c c) Problem: 8bit characters were displayed/interpreted wrong in psql This is due to the fact that the Win32 "console" uses a different encoding than the rest of the Windows system Solution: Introduced a new psql variable WIN32_CONSOLE When set with "\set WIN32_console", the function OemToChar() is applied after reading input and CharToOem() before displaying Output Christoph Dalitz
Diffstat (limited to 'src/bin/psql/input.c')
-rw-r--r--src/bin/psql/input.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/bin/psql/input.c b/src/bin/psql/input.c
index 26fe7659e2a..b220ed89418 100644
--- a/src/bin/psql/input.c
+++ b/src/bin/psql/input.c
@@ -3,13 +3,17 @@
*
* Copyright 2000 by PostgreSQL Global Development Group
*
- * $Header: /cvsroot/pgsql/src/bin/psql/input.c,v 1.25 2003/07/25 19:27:06 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/bin/psql/input.c,v 1.26 2003/07/27 03:32:26 momjian Exp $
*/
#include "postgres_fe.h"
#include "input.h"
#include <errno.h>
+#ifdef WIN32
+#include <windows.h>
+#endif
+
#include "pqexpbuffer.h"
#include "settings.h"
#include "tab-complete.h"
@@ -42,6 +46,15 @@ static void finishInput(int, void *);
#define PSQLHISTORY ".psql_history"
+#ifdef WIN32
+ /*
+ * translate DOS console character set into ANSI, needed e.g. for
+ * German umlauts
+ */
+ if (GetVariableBool(pset.vars, "WIN32_CONSOLE"))
+ OemToChar(s, s);
+#endif
+
#ifdef USE_READLINE
static enum histcontrol
GetHistControlConfig(void)