psql 无法显示德语“Umlaute”

时间:2021-06-05 13:25:45

标签: windows postgresql psql

我正在使用 psql 并意识到德语字母 ä、ö、ü 未正确显示。例如,ö 显示为 õ。 ü 在指数中显示为三...

WARNING: Console code page (850) differs from Windows code page 
(1252) 8-bit characters might not work correctly. See psql 
reference page "Notes for Windows users" for details.

我该如何改变?

操作系统:Windows 10 psql 13.3

我导入到 postgres 的表是用 UTF8 编码的。

我是 postgres 和 psql 的新手,很抱歉问这个愚蠢的问题。

enter image description here

enter image description here

在第二个打印屏幕中,您可以看到“Eigentümer”、“Zürich”和“Graubünden”中的字符“ü”显示不正确。

2 个答案:

答案 0 :(得分:1)

我遇到了同样的问题;只需使用

<块引用>

\encoding 'UTF8'

答案 1 :(得分:0)

  1. 从命令行或终端:

    chcp 1252

  2. 打开 psql

    psql -U postgres

  3. 设置客户端编码:

    SET client_encoding='WIN1252'

  4. 导入文件:

    \i Path/to/your/.sqlFile