PostgreSql:“utf8”编解码器无法解码位置 42 中的字节 0xe9:连续字节无效

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/45897521/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-21 02:37:52  来源:igfitidea点击:

PostgreSql: 'utf8' codec can't decode byte 0xe9 in position 42: invalid continuation byte

postgresqlpgadmin-4

提问by narcisse

I recently installed PostgreSql and I am trying to create a new database. Unfortunetly I got and error while creating the database:

我最近安装了 PostgreSql,我正在尝试创建一个新数据库。不幸的是,我在创建数据库时出错:

"'utf8' codec can't decode byte 0xe9 in position 42: invalid continuation byte" enter image description here

“‘utf8’编解码器无法解码位置 42 中的字节 0xe9:无效的连续字节” 在此处输入图片说明

What is the problem exactly thank you

具体是什么问题谢谢

回答by zesage

Try to add the following line at the end of the pg_hba.conf file and then restart the PostgreSQL service:

尝试在 pg_hba.conf 文件末尾添加以下行,然后重新启动 PostgreSQL 服务:

host    all             all             all                 md5

回答by Walter D

I had a similar error when upgrading from 4.5 to 4.7, the solution was to restart the pgAdmin server.

我在从 4.5 升级到 4.7 时遇到了类似的错误,解决方案是重新启动 pgAdmin 服务器。

My error was: Error: 'utf-8' codec can't decode byte 0xe9 in position 0: invalid continuation byte

我的错误是:错误:'utf-8'编解码器无法解码位置 0 的字节 0xe9:连续字节无效

回答by Sindre

I tried all the solutions above. None worked.

我尝试了上述所有解决方案。没有一个工作。

The solution for me was to install US ENGLISH as my language on my windows 10. Then I did the installation all over again in that language.

我的解决方案是在我的 Windows 10 上安装 US ENGLISH 作为我的语言。然后我再次使用该语言进行安装。

It's working now, and I do not have use US ENGLISH as my windows language xD

它现在可以工作了,我没有使用美国英语作为我的 Windows 语言 xD

回答by dotista2008

It's a conflict between local languages. PgAdmin is in English but maybe in the conf file the lc_messages variable is French, Spanish or something else. Try this

这是当地语言之间的冲突。PgAdmin 是英文的,但可能在 conf 文件中 lc_messages 变量是法语、西班牙语或其他内容。试试这个

lc_messages = 'en_US'