Re: v8.3 + UTF8 errors when restoring DB - Mailing list pgsql-general

From Mitchell D. Russell
Subject Re: v8.3 + UTF8 errors when restoring DB
Date
Msg-id 47d3b806.111f400a.53cb.ffffd6c4@mx.google.com
Whole thread Raw
In response to v8.3 + UTF8 errors when restoring DB  ("Mitchell D. Russell" <mitchell.russell@gmail.com>)
Responses Re: v8.3 + UTF8 errors when restoring DB  (Martijn van Oosterhout <kleptog@svana.org>)
List pgsql-general

Just as an update to this matter, I created another new database with SQL_ASCII encoding and imported the data, and it worked fine, however, I don’t think that’s the best solution because SQL_ASCII’s not a good way to have the database encoding set, right?

 

Thanks again for any suggestions.

 

Mitch

 

 

From: Mitchell D. Russell [mailto:mitchell.russell@gmail.com]
Sent: Sunday, March 09, 2008 5:46 AM
To: 'pgsql-general@postgresql.org'
Subject: v8.3 + UTF8 errors when restoring DB

 

New to the list, so please forgive me in advance :)


I've been running 8.2 on windows server 2003 for quite some time now. The database that I take care of stores records with various languages in it (russian, chinese, etc) and has been working fine.

I did a PG_dump of the database tonight, and went to restore it to my newly created database (WIN2152 encoding), which worked fine, but when I go to retrieve the data via my code (.NET c#), I get errors like :

character 0x8f of encoding "WIN1252" has no equivalent in "UTF8"
character 0x81 of encoding "WIN1252" has no equivalent in "UTF8"
character 0x9d of encoding "WIN1252" has no equivalent in "UTF8"

The database driver is set to unicode mode, so I turned that off, but of course end up with gibberish instead of the russian and chinese that were there before.

So then I tried creating a new database with unicode formatting and restoring my 8.2 dump file to that, when I do that, I get these errors (using PSQL):

ERROR: invalid byte sequence for encoding "UTF8": 0x92
HINT: This error can also happen if the byte sequence does not match the encoding expected by the server, which is controlled by "client_encoding".

CONTEXT: COPY cin_tbl_data, line 6
ERROR: invalid byte sequence for encoding "UTF8": 0x99
HINT: This error can also happen if the byte sequence does not match the encoding expected by the server, which is controlled by "client_encoding".

so I just don't know what to do. my 8.2 database used SET client_encoding = 'SQL_ASCII'; according to the dump file - so I can't wrap my head around why I can't get this data to come out.

Any help would be very much appreciated.

pgsql-general by date:

Previous
From: "Mitchell D. Russell"
Date:
Subject: v8.3 + UTF8 errors when restoring DB
Next
From: Martijn van Oosterhout
Date:
Subject: Re: v8.3 + UTF8 errors when restoring DB