Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to change console code to 1252?

I am trying to use PostgreSQL on Windows 8 using the command line provided by Git Bash so I can run Unix like commands. When accessing Postgres with the following command: psql -U postgres I get:

Warning: Console code page (850) differs from Windows code page (1252) etc...

in the Windows command tool, I just need to type chcp 1252 before accessing Postgres so the warning doesn't show up. What's the equivalent command in unix/git bash?

I tried to do chcp 1252 or chcp from Git bash but it outputs:

sh.exe": chcp: command not found

Any ideas?

like image 817
Bondifrench Avatar asked Dec 01 '22 19:12

Bondifrench


2 Answers

Try "chcp.com 1252".

Git bash doesn't suppose ".com" as a implicit executable postfix. It can't expand "chcp" to correct executable, so you should type fully "chcp.com".

like image 59
lurdan Avatar answered Dec 04 '22 05:12

lurdan


You're using the Windows psql.exe binary under the msys bash.

This may not work well, as psql.exe is a Win32 binary. It uses stdio, but not the same way bash expects.

You'll want to either use a psql built against msys (not trivial), or use psql under cmd.exe or powershell.

like image 44
Craig Ringer Avatar answered Dec 04 '22 05:12

Craig Ringer