Warning console code page (437) differs from Window code page (1252)

From: "John" <nnoddy(at)lizzy(dot)com(dot)au>
To: <pgsql-novice(at)postgresql(dot)org>
Subject: Warning console code page (437) differs from Window code page (1252)
Date: 2012-03-13 05:01:50
Message-ID: 0C1D4413D55F44F9B93E6245B230870D@user3
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Just a note for Windows users
I had a drama with psql (only \x commands worked -- probably self made)
At boot up this psql warning appeared
Warning console code page (437) differs from Window code page (1252)

I found the runsql.bat file and added
cmd.exe /c chcp 0437

to the top and saved it

When run the runsql.bat file reset the code page, returned
"Active code page 437",
got rid of the warning and psql began working (coincidence?)

The bat file and system particulars follow below.
Thanks all John Coffey

---------------------------------------------------------------------------------------------
Database

Instalation file postgresql-9.1.3-1-windows.exe

Postgresql =#SELECT version();

PostgreSQL 9.1.3, complied by Visual C++ build 1500, 32 bit

==========================

Operating System

Windows XP version 5.1 (build 2600.xpsp.080413-2111: Service Pack 3)

Copyright 2007

----------------------------------------------------

runsql.bat

@echo on

REM Coffey Set window codepage to legacy 437 to circumvent warning

REM Warning console code page (437) differs from Window code page (1252)

cmd.exe /c chcp 0437

REM PostgreSQL server psql runner script for Windows

REM Dave Page, EnterpriseDB

SET server=localhost

SET /P server="Server [%server%]: "

SET database=postgres

SET /P database="Database [%database%]: "

SET port=5432

SET /P port="Port [%port%]: "

SET username=postgres

SET /P username="Username [%username%]: "

for /f "delims=" %%a in ('chcp ^|find /c "932"') do @ SET CLIENTENCODING_JP=%%a

if "%CLIENTENCODING_JP%"=="1" SET PGCLIENTENCODING=SJIS

if "%CLIENTENCODING_JP%"=="1" SET /P PGCLIENTENCODING="Client Encoding [%PGCLIENTENCODING%]: "

REM Run psql

"C:\Program Files\PostgreSQL\9.1\bin\psql.exe" -h %server% -U %username% -d %database% -p %port%

pause

Browse pgsql-novice by date

  From Date Subject
Next Message James Martens 2012-03-13 08:30:31 Updating RHEL4 system for PHP; requires Postgresql updates
Previous Message Nicholas Wilson 2012-03-12 20:31:42 converting 1 dimensional array to 2 dimensional array