--- src/bin/psql/input.c.orig	Fri Sep  5 12:18:24 2003
+++ src/bin/psql/input.c	Fri Sep  5 12:18:45 2003
@@ -45,7 +45,8 @@
 #define PSQLHISTORY ".psql_history"
 
 
-#ifdef WIN32
+#if 0
+//#ifdef WIN32
 
  /*
   * translate DOS console character set into ANSI, needed e.g. for German
--- src/bin/psql/mbprint.c.orig	Fri Sep  5 12:24:56 2003
+++ src/bin/psql/mbprint.c	Fri Sep  5 12:29:19 2003
@@ -334,7 +334,8 @@
 		return mb_utf_validate(pwcs);
 	else
 	{
-#ifdef WIN32
+#if 0
+//#ifdef WIN32
 
 		/*
 		 * translate characters to DOS console encoding, e.g. needed for
--- src/bin/psql/describe.c.orig	Fri Sep  5 12:41:06 2003
+++ src/bin/psql/describe.c	Fri Sep  5 12:42:22 2003
@@ -765,7 +765,7 @@
 	{
 		/* Name */
 #ifdef WIN32
-		cells[i * cols + 0] = mbvalidate(PQgetvalue(res, i, 0));
+		cells[i * cols + 0] = mbvalidate(PQgetvalue(res, i, 0),pset.encoding);
 #else
 		cells[i * cols + 0] = PQgetvalue(res, i, 0);	/* don't free this
 														 * afterwards */
@@ -773,7 +773,7 @@
 
 		/* Type */
 #ifdef WIN32
-		cells[i * cols + 1] = mbvalidate(PQgetvalue(res, i, 1));
+		cells[i * cols + 1] = mbvalidate(PQgetvalue(res, i, 1),pset.encoding);
 #else
 		cells[i * cols + 1] = PQgetvalue(res, i, 1);	/* don't free this
 														 * either */
@@ -797,7 +797,7 @@
 			}
 
 #ifdef WIN32
-			cells[i * cols + 2] = xstrdup(mbvalidate(tmpbuf.data));
+			cells[i * cols + 2] = xstrdup(mbvalidate(tmpbuf.data,pset.encoding));
 #else
 			cells[i * cols + 2] = xstrdup(tmpbuf.data);
 #endif
@@ -806,7 +806,7 @@
 		/* Description */
 		if (verbose)
 #ifdef WIN32
-			cells[i * cols + cols - 1] = mbvalidate(PQgetvalue(res, i, 5));
+			cells[i * cols + cols - 1] = mbvalidate(PQgetvalue(res, i, 5),pset.encoding);
 #else
 			cells[i * cols + cols - 1] = PQgetvalue(res, i, 5);
 #endif
--- src/bin/psql/win32.mak.orig	Fri Sep  5 12:43:02 2003
+++ src/bin/psql/win32.mak	Fri Sep  5 12:46:38 2003
@@ -33,6 +33,7 @@
 	-@erase "$(INTDIR)\print.obj"
 	-@erase "$(INTDIR)\describe.obj"
 	-@erase "$(INTDIR)\tab-complete.obj"
+	-@erase "$(INTDIR)\sprompt.obj"
 	-@erase "$(INTDIR)\getopt.obj"
 	-@erase "$(INTDIR)\getopt_long.obj"
 	-@erase "$(INTDIR)\path.obj"
@@ -70,6 +71,7 @@
 	"$(INTDIR)\print.obj" \
 	"$(INTDIR)\describe.obj" \
 	"$(INTDIR)\tab-complete.obj" \
+	"$(INTDIR)\sprompt.obj" \
 	"$(INTDIR)\getopt.obj" \
 	"$(INTDIR)\getopt_long.obj" \
 	"$(INTDIR)\path.obj" \
@@ -79,6 +81,11 @@
 "$(OUTDIR)\psql.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
     $(LINK32) @<<
   $(LINK32_FLAGS) $(LINK32_OBJS)
+<<
+
+"$(OUTDIR)\sprompt.obj" : "$(OUTDIR)" ..\..\port\sprompt.c
+    $(CPP) @<<
+    $(CPP_PROJ) ..\..\port\sprompt.c
 <<
 
 "$(OUTDIR)\getopt.obj" : "$(OUTDIR)" ..\..\port\getopt.c
--- src/include/port.h.orig	Fri Sep  5 11:55:37 2003
+++ src/include/port.h	Fri Sep  5 11:56:30 2003
@@ -111,10 +111,10 @@
 
 /* thread.h */
 extern char *pqStrerror(int errnum, char *strerrbuf, size_t buflen);
-
+#if !defined(_MSC_VER) && !defined(__BORLANDC__)
 extern int pqGetpwuid(uid_t uid, struct passwd * resultbuf, char *buffer,
 		   size_t buflen, struct passwd ** result);
-
+#endif
 extern int pqGethostbyname(const char *name,
 				struct hostent * resbuf,
 				char *buf, size_t buflen,
--- src/interfaces/libpq/win32.mak.orig	Fri Sep  5 12:06:18 2003
+++ src/interfaces/libpq/win32.mak	Fri Sep  5 12:05:32 2003
@@ -39,6 +39,7 @@
 	-@erase "$(INTDIR)\getaddrinfo.obj"
 	-@erase "$(INTDIR)\inet_aton.obj"
       -@erase "$(INTDIR)\crypt.obj"
+	-@erase "$(INTDIR)\thread.obj"
 	-@erase "$(INTDIR)\path.obj"
 	-@erase "$(INTDIR)\dllist.obj"
 	-@erase "$(INTDIR)\md5.obj"
@@ -82,6 +83,7 @@
 	"$(INTDIR)\getaddrinfo.obj" \
 	"$(INTDIR)\inet_aton.obj" \
       "$(INTDIR)\crypt.obj" \
+	"$(INTDIR)\thread.obj" \
 	"$(INTDIR)\path.obj" \
 	"$(INTDIR)\dllist.obj" \
 	"$(INTDIR)\md5.obj" \
@@ -139,6 +141,11 @@
 "$(OUTDIR)\crypt.obj" : ..\..\port\crypt.c
     $(CPP) @<<
     $(CPP_PROJ) ..\..\port\crypt.c
+<<
+
+"$(OUTDIR)\thread.obj" : ..\..\port\thread.c
+    $(CPP) @<<
+    $(CPP_PROJ) ..\..\port\thread.c
 <<
 
 "$(OUTDIR)\path.obj" : ..\..\port\path.c
--- src/port/thread.c.orig	Fri Sep  5 12:02:01 2003
+++ src/port/thread.c	Fri Sep  5 12:02:36 2003
@@ -66,6 +66,7 @@
  * Wrapper around getpwuid() or getpwuid_r() to mimic POSIX getpwuid_r()
  * behaviour, if it is not available or required.
  */
+#if !defined(_MSC_VER) && !defined(__BORLANDC__)
 int
 pqGetpwuid(uid_t uid, struct passwd *resultbuf, char *buffer,
 		   size_t buflen, struct passwd **result)
@@ -84,7 +85,7 @@
 #endif
 	return (*result == NULL) ? -1 : 0;
 }
-
+#endif
 /*
  * Wrapper around gethostbyname() or gethostbyname_r() to mimic
  * POSIX gethostbyname_r() behaviour, if it is not available or required.
