Installed PostgreSQL 9.4, PgAdmin III 1.20 Version. Created Bases, pgadmin by default creates bases with utf-8 encodings. When we add Russian characters to the table in the database through an .sql file, all Russian characters in the database are crooked.
pgadmin, postgresql encoding problem

I wanted to fix this problem, I looked for google and found this: PostgreSQL - Cyrillic in psql under Windows

I opened cmd and wanted to write tips from the found site, but cmd.exe also such a problem: enter image description here

I do not know how to fix this problem. Help please solve this problem. Type of operating system: Windows 7 Corporate ( Service Pack 1 )

  • 2
    UTF-8 .sql file? Write it to the database with what? And cmd generally works in cp866. And chcp 1251 must be run at the cmd (>) prompt, not pgsql (#). But in any case it does not help if the utf file. - Sergey
  • Checked the file on notepad ++, there the coding is utf-8 (without BOM) - Saahon
  • Well, download it through the same admin. Admin opens the sql in utf-8 encoding, if there is a parameter in the settings. - Sergey
  • The .sql files are run via the java spring framework. When you first start the application, it creates tables and fills tables through this sql file - Saahon
  • Does the framework load them? Or do you read the file with your function? In any case, you must specify the file encoding or freyverku or when opening the file. The default will surely be win1251. - Sergey

0