Skip site navigation (1) Skip section navigation (2)


From: Christoph Dalitz <christoph(dot)dalitz(at)hs-niederrhein(dot)de>
To: Manfred Spraul <manfred(at)colorfullife(dot)com>
Cc: pgman(at)candle(dot)pha(dot)pa(dot)us, peter_e(at)gmx(dot)net,pgsql-patches(at)postgresql(dot)org, pgsql-hackers-win32(at)postgresql(dot)org,pgsql-cygwin(at)postgresql(dot)org
Subject: Re: [PATCHES] WIN32_CONSOLE usage
Date: 2003-09-08 10:27:05
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-cygwinpgsql-hackers-win32pgsql-patches
On Sun, 07 Sep 2003 20:37:08 +0200
Manfred Spraul <manfred(at)colorfullife(dot)com> wrote:
> >>I think we ought to detect the console type automatically anyway.
> >>Certainly we don't want people to have to set this variables all the time.
> >>    
> Does input from the console work correctly right now?
> What about setting the code page of the console to the ansi code page? 
> Or to the code page that postgresql uses internally.
>     SetConsoleCP(GetACP());
>     SetConsoleOutputCP(GetACP());
> might be sufficient.
Shame on me!

Manfred's suggestion works perfectly. I did not realize this because the default
"rasterfont" for the win32 console cannot be used with codepage 1252 (windows
codepage on my system). When I switch to the font "Lucida Console" however, all
is fine with codepage 1252.

I have found this soultion here:

Actually no psql tweaks are necessary at all, because the codepage for a console window
can be set with "cmd.exe /c chcp 1252". When I put this in my .bashrc, I actuallay
can use umlauts.

Sorry for producing some inconviniences in the psql devellopment.

The easiest would be to withdraw the WIN32_CONSOLE stuff from psql, replace it with
Manfred's solution and add to the documentation a tutorial how to make 8-bit characters
work in the Win32 console (with Manfred's solution, it actually only requires to set
the console font to "Lucida Console"). Alternatively no tweaks to psql could be done,
and the documentation should describe how the console can be forced to use the proper
encoding (this is certainly of interest to all win32 users of other applictaions as

Christoph Dalitz

In response to


pgsql-cygwin by date

Next:From: raj_14_11Date: 2003-09-08 11:16:48
Subject: Re: cygrunsrv -S postmaster giving error
Previous:From: raj_14_11Date: 2003-09-08 10:23:50
Subject: cygrunsrv -S postmaster giving error

pgsql-patches by date

Next:From: Andreas PflugDate: 2003-09-08 10:52:26
Subject: Re: Unixware 713 probs
Previous:From: Gaetano MendolaDate: 2003-09-08 09:33:52
Subject: Re: mcxt.c

pgsql-hackers-win32 by date

Next:From: Darko PrenosilDate: 2003-09-08 11:12:45
Subject: Re: [pgsql-hackers-win32] Windows CHM format for the documents
Previous:From: Andreas PflugDate: 2003-09-08 10:05:43
Subject: Re: [pgsql-hackers-win32] Windows CHM format for the documents

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group