psql shell uses code page 850, windows uses 1252. How to solve change console code page?

What is your database Character Set? If it is UTF-8, then before running, what ever you want in psql, just tell the console to use the UTF-8 encoding: cmd.exe /c chcp 65001


I had the same problem in Windows 10.

In psql type ! chcp

it revealed my setting as 850. This I changed to 1252 by doing the following.

! dir revealed a file runpsql.bat in C:\Program Files\PostgreSQL\9.6\scripts

From windows after exiting psql I ran Notebook in Administrator mode and added above the REM Run psql statement the command chcp 1252

Now runs without the warnings