How to set Talend client encoding for jdbc use?

One Star

How to set Talend client encoding for jdbc use?

Hi,

When I try to import data from mdb file to Postgres database the following error appears cause some rows have characters with accent ('è', 'é', 'à') .
DBD::Pg::st execute failed: ERROR:  invalid byte sequence for encoding "UTF8": 0xe87265
can't execute insert query

Postgres database encoding is 'UTF8' whereas Mdb file encoding seems to be 'ISO-8859-15'. ODBC is used to read mdb file while JDBC is used to connect to postgres. Can we say to postgres what encoding is used for sent data? I know that jdbc provide a "charSet" parameter but I did not know how to use it with Talend.
Does somebody has an idea of how to set client encoding within Talend? :/
Thanks,
Matthieu (TOS newbie Smiley Happy )

Accepted Solutions
Employee

Re: How to set Talend client encoding for jdbc use?

Only MySQL connection encoding is modified when encoding is set to UTF-8. We have to do it also for PostgreSQL. I don't know yet how to do this, I'll search PostgreSQL documentation. Can you create a bug entry for this?

All Replies
Employee

Re: How to set Talend client encoding for jdbc use?

Only MySQL connection encoding is modified when encoding is set to UTF-8. We have to do it also for PostgreSQL. I don't know yet how to do this, I'll search PostgreSQL documentation. Can you create a bug entry for this?
Four Stars

Re: How to set Talend client encoding for jdbc use?

Hi,
in PostgreSQL it is possible to set the client decoding to a different charset than the server. Maybe you can use this.
See section -> 20.2.3. Automatic Character Set Conversion Between Server and Client:
http://www.postgresql.org/docs/8.0/interactive/multibyte.html
One Star

Re: How to set Talend client encoding for jdbc use?

I read this post too which talk about client decoding but here we cannot use this cause, if I understood, it is applied for all client connections...
I don't think our DBA likes it Smiley Wink
So to answer Plegall, I will create a bug entry.
Thanks for your answers,
Matthieu
Four Stars

Re: How to set Talend client encoding for jdbc use?

Hi,
I'm sorry. I didn't know that the link was already posted. But you can use a SQL command in PostgreSQL to set the client session encoding, that is only valid for the session you're using. So you won't be making your DBA angry. In the PostgreSQL list archives sombody did I nice post about it.
Mayby you can use or test it:
http://archives.postgresql.org/pgsql-jdbc/2004-11/msg00075.php
He uses the SQL command: SET CLIENT_ENCODING TO Latin1
I hope this helps a little bit.
One Star

Re: How to set Talend client encoding for jdbc use?

Hi,
The bug has been fixed today (see 372).
Thank you very much Plegall for you reactivity Smiley Very Happy It works!
Matthieu