Debian 8 Jessie中的CP1250(WIN1250)编码

时间:2017-02-28 18:28:43

标签: postgresql encoding debian

我必须将Win1250(CP1250; pl_PL.cp1250)编码安装到我的Debian 8 Jessie,但我不知道如何做到这一点。我需要这个从外部文件(外部公司)初始化Postgres数据库。当我尝试启动此数据库时,我收到错误

#/usr/lib/postgresql/9.5/bin/initdb -E WIN1250 -D /usr/local/phsql/data

The database cluster will be initialized with locale "pl_PL.UTF-8".
        initdb:encoding mismatch
        The encoding you selected (WIN1250) and the encoding that the selected locale uses (UTF8) do not match. This would lead to misbehavior in various character string processing functions. Rerun initdb and either do not specify and encoding explicitly, or choose a matching combination.

但是我可以在没有指定编码的情况下重新运行initdb,因为外部应用程序必须连接到数据库WITH编码WIN1250 :(

请帮帮我。

1 个答案:

答案 0 :(得分:1)

好的,我有一个解决方案:)

必须编辑/etc/locale.gen和/etc/locale.alias,然后只需添加pl_PL.CP1250即可。接下来,您必须通过dpkg-recofigure locales重新配置语言环境。它有效:)