Could not convert UTF-8 character to ISO8859-1?

Started by Bjørn T Johansenover 20 years ago5 messagesgeneral
Jump to latest
#1Bjørn T Johansen
btj@havleik.no

I am trying to copy data from a MSSQL srv to PGSQL srv 8 using Delphi under Windows... But
I just keep getting this error... Why? (My PGSQL server is using LATIN1)
And how do I get around this?

BTW; I see in the log for my PGSQL server that someone is setting Client encoding to
UTF-8, but I am not... Is this some default setting in pgodbc or? I can't find any place
to change this value....

Regards,

BTJ

--
-----------------------------------------------------------------------------------------------
Bj�rn T Johansen

btj@havleik.no
-----------------------------------------------------------------------------------------------
Someone wrote:
"I understand that if you play a Windows CD backwards you hear strange Satanic messages"
To which someone replied:
"It's even worse than that; play it forwards and it installs Windows"
-----------------------------------------------------------------------------------------------

#2Ropel
ropel@ropel.it
In reply to: Bjørn T Johansen (#1)
Re: Could not convert UTF-8 character to ISO8859-1?

As far as I know, UTF-8 is the standard encoding used by MSSQL.
ISO8859-1 /_is_ /LATIN1, so the system is trying to convert (as the
error message says) from utf-8 (SqlServer) to ISO8859-1 ( LATIN1 ).

So I think you have to search on the MSSQL side, not PostgreSql...

You can also use UNICODE encoding on postgres, creating your DB with
CREATE DATABASE mydb ENCODING='UNICODE';

Hope this will give you some hints to solve the problem

Regards,
Roberto

Bj�rn T Johansen wrote:

Show quoted text

I am trying to copy data from a MSSQL srv to PGSQL srv 8 using Delphi under Windows... But
I just keep getting this error... Why? (My PGSQL server is using LATIN1)
And how do I get around this?

BTW; I see in the log for my PGSQL server that someone is setting Client encoding to
UTF-8, but I am not... Is this some default setting in pgodbc or? I can't find any place
to change this value....

Regards,

BTJ

#3Bjørn T Johansen
btj@havleik.no
In reply to: Ropel (#2)
Re: Could not convert UTF-8 character to ISO8859-1?

I don't think you are correct... UTF-8 might be default on MSSQL, but it is the ODBC
connection to PGSQL that sets the client encoding to UTF-8... (I.e. when I just connect to
the PGSQL server, I get a statement in the PG log file that says "set client_encoding to
'UTF8'..

And I don't want to use UNICODE on my PG Server....

BTJ

Ropel wrote:

Show quoted text

As far as I know, UTF-8 is the standard encoding used by MSSQL.
ISO8859-1 /_is_ /LATIN1, so the system is trying to convert (as the
error message says) from utf-8 (SqlServer) to ISO8859-1 ( LATIN1 ).

So I think you have to search on the MSSQL side, not PostgreSql...

You can also use UNICODE encoding on postgres, creating your DB with
CREATE DATABASE mydb ENCODING='UNICODE';

Hope this will give you some hints to solve the problem

Regards,
Roberto

Bj�rn T Johansen wrote:

I am trying to copy data from a MSSQL srv to PGSQL srv 8 using Delphi under Windows... But
I just keep getting this error... Why? (My PGSQL server is using LATIN1)
And how do I get around this?

BTW; I see in the log for my PGSQL server that someone is setting Client encoding to
UTF-8, but I am not... Is this some default setting in pgodbc or? I can't find any place
to change this value....

Regards,

BTJ

#4John DeSoi
desoi@pgedit.com
In reply to: Bjørn T Johansen (#3)
Re: Could not convert UTF-8 character to ISO8859-1?

On Jul 24, 2005, at 1:52 PM, Bjørn T Johansen wrote:

I don't think you are correct... UTF-8 might be default on MSSQL,
but it is the ODBC
connection to PGSQL that sets the client encoding to UTF-8... (I.e.
when I just connect to
the PGSQL server, I get a statement in the PG log file that says
"set client_encoding to
'UTF8'..

And I don't want to use UNICODE on my PG Server....

After you login try executing "SET client_encoding TO LATIN1"

I don't use ODBC so I don't know if this will mess things up, but it
might be worth a try.

John DeSoi, Ph.D.
http://pgedit.com/
Power Tools for PostgreSQL

#5Bjørn T Johansen
btj@havleik.no
In reply to: John DeSoi (#4)
Re: Could not convert UTF-8 character to ISO8859-1?

Yes, that did the trick... I tried to execute the same statement at the same time as I did
the insert, but it needed to be in a separate statement....

Thx.... :)

BTJ

John DeSoi wrote:

Show quoted text

On Jul 24, 2005, at 1:52 PM, Bj�rn T Johansen wrote:

I don't think you are correct... UTF-8 might be default on MSSQL, but
it is the ODBC
connection to PGSQL that sets the client encoding to UTF-8... (I.e.
when I just connect to
the PGSQL server, I get a statement in the PG log file that says "set
client_encoding to
'UTF8'..

And I don't want to use UNICODE on my PG Server....

After you login try executing "SET client_encoding TO LATIN1"

I don't use ODBC so I don't know if this will mess things up, but it
might be worth a try.

John DeSoi, Ph.D.
http://pgedit.com/
Power Tools for PostgreSQL