> >
authorBruce Momjian
Mon, 29 Sep 2003 18:21:33 +0000 (18:21 +0000)
committerBruce Momjian
Mon, 29 Sep 2003 18:21:33 +0000 (18:21 +0000)
> >  a) Write documentation how the win32 console needs to be set up so that
> >     psql can handle 8-bit characters.
> >     Where should it be added? The Section "Installation on Windows" in the
> >     Administrator's Guide seems natural to me.
> >
> >  b) Add code to psql that prints a warning on startup of psql when the
> >     console codepage differs from the windows codepage, something like
> >
> >     Warning: Console codepage (850) differs from windows codepage (1252)
> >              8-bit characters will not work correctly. See PostgreSQL
> >              documentation "Installation on Windows" for details.
>
Attached are two patches:

 - installdoc.patch contains an additional paragraph on the win32 console
   codepage for the chapter "Installation on Windows"
   Due to a lack of SGML-tools, I have only edited the text and not tested
   the SGML code - please check it before merging into the CVS branch.

 - psqlcodepage.patch adds the warning about a problematic codepage to psql.

Christoph Dalitz

doc/src/sgml/install-win32.sgml
src/bin/psql/startup.c

index 16dfdbdc8f6b731a3c63dce44d127f8d7d0d1e66..21b3daad4e38bbc9a0f776059c9b9d82b85fdd94 100644 (file)
@@ -1,5 +1,5 @@
 
 
 
@@ -107,6 +107,33 @@ $Header: /cvsroot/pgsql/doc/src/sgml/install-win32.sgml,v 1.12 2003/09/29 18:18:
   C++, just right-click on the project and choose to add it.)
  
 
+  psql is compiled as a "console application". As
+  the win32 console windows use a different encoding than the rest of the
+  system, you must take special care when using 8-bit characaters (eg. german
+  Umlauts) at the psql prompt. When
+  psql detects a problematic console codepage, it
+  will warn you at startup. To change the console codepage, two things are
+  neccessary:
+
+  
+   
+    
+      Set the codepage with cmd.exe /c chcp 1252
+     (1252 is the german value, replace it with your value). If you are using
+     cygwin, you can put this command in /etc/profile.
+    
+   
+   
+    
+      Set the console font to "Lucida Console", because the raster font
+     does not work with the ANSI codepage.
+    
+   
+  
+
+