编码“UTF-8”的字符0xc286在“WIN1252”...中没有等效项。在使用iconv postgres进行转换时,恢复崩溃 [英] character 0xc286 of encoding "UTF-8" has no equivalent in "WIN1252"....On conversion with iconv postgres restore crashes

查看:511
本文介绍了编码“UTF-8”的字符0xc286在“WIN1252”...中没有等效项。在使用iconv postgres进行转换时,恢复崩溃的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用一个使用delphi和postgres 9.0,
的软件,原始开发人员选择数据库编码为 SQL_ASCII '...
,因此我们更改了对我们的数据库编码为 UTF-8
我们在

I'm working on a software that uses delphi and postgres 9.0, the original developer had chosen the database encoding as 'SQL_ASCII'... so we changed the encoding to UTF-8 for our database.. we we started getting this error after


点击其中一个复选框
(表单从数据库填充)
错误来源的查询是

Onclick of the One of the check boxes (the form is populated from the database) the query where the error comes is


'select * from diary where survey in('2005407')';

'select * from diary where survey in ('2005407')';

,但此错误仅适用于部分复选框,而不是全部

but this error only comes for few of the check boxes and not ALL

更改是直接的,但我们有大量的历史数据,我们必须重新存储到新创建的 UTF-8 数据库。我遵循我在net和stackoverflow上发现的步骤

The change is straight forward but we have large amount of historical data that we will have to re-store into the newly created UTF-8 database..so i followed the steps i found on the net and stackoverflow also


  1. 将数据库转储为e- UTF-8 SQL_Ascii_backup.backup

  2. 使用iconv将 SQL_ASCII 转换为 UTF-8

"C:\Program Files\GnuWin32\bin\iconv.exe" -f ISO8859-1 -t UTF-8 C:\SQL_Ascii_backup.backup>UTF_Backup.backup

3.创建一个以UTF-8编码的新数据库并重新存储备份 UTF_Backup.backup

3.Create a new Database with encoding as UTF-8 and re-store the backup UTF_Backup.backup

恢复它我得到他的错误

But when i try to restore it i get t his error

然后我尝试将原始 SQL_ASCII 数据库转储为 SQL_Ascii_.sql file
然后再次使用iconv更改编码,然后恢复

then i tried with dumping the original SQL_ASCII database as plain SQL_Ascii_.sql file and then again i used iconv to change the encoding..and then restoring

  >"C:\Program Files\PostgreSQL\9.0\bin\psql.exe"-h localhost -p 5434 -d myDB -U myDB_admin -f C:\converted_utf8.sql

这是正确还原,但仍然会显示错误。

this is restoring properly but im still geting the error.


'character 0xc286的编码UTF-8在WIN1252中没有等效项;

'character 0xc286 of encoding "UTF-8" has no equivalent in "WIN1252";


推荐答案

C2 86是字符U + 0086的UTF-8编码,这是一个模糊的 C1控制字符。此字符存在于 ISO-8859-1 中,但不在Windows的默认值代码页1252 ,其在ISO-8859-1具有C1控件的空间中具有可打印字符。

C2 86 is the UTF-8 encoding of the character U+0086, an obscure C1 control character. This character exists in ISO-8859-1, but not in Windows' default code page 1252, which has printable characters in the space where ISO-8859-1 has the C1 controls.

您的iconv命令转换为UTF-8有 -f ISO8859-1 ,但你可能意味着 -f windows- 1252 。这将字节86映射到字符。

Your iconv command to convert to UTF-8 has -f ISO8859-1, but your probably meant -f windows-1252 instead. This maps the byte 86 to the character.

这篇关于编码“UTF-8”的字符0xc286在“WIN1252”...中没有等效项。在使用iconv postgres进行转换时,恢复崩溃的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆