Wrong character encoding in mysql result using characterSetResults prp

One Star

Wrong character encoding in mysql result using characterSetResults prp

Hi,
I've problem with tMysqlConnection. Data in the databse are stored in latin1 so I need to set up jdbc connector to use this character set. Unfortunately setting up tMysqlConnection Additional JDBC Parameters to "characterSetResults=CP1252" (latin1, iso8859_1) does not affect output.
When I connect on the server and use following connection command everything goes right:
mysql -p pc --default-character-set=latin1
mysql> select last_name from candidate where candidate_id=3;
+-------------+
| last_name |
+-------------+
| Ková?ová |

Same when I'm connecting with MySQL workbench:
SET character_set_results = latin1;
SELECT last_name FROM `pc`.`candidate` where candidate_id=3;

Is there a way to run "SET character_set_results = latin1"; command before any future select? Or is there way to make connection right?
Community Manager

Re: Wrong character encoding in mysql result using characterSetResults prp

Hi
1. Append this parameter useUnicode=true&characterEncoding=xxx into tMysqlConnection Additional JDBC Parameters.
or
2. Use a tMysqlRow to execute statement ""SET character_set_results = xxx" before any future select, eg:
tMysqlConnnection
|
onsubjobok
|
tMysqlRow
|
onsubjobok
|
tMysqlInput--main-->tLogRow
|
onsubjobok
|
tMysqlCommit
on tMysqlRow, check the box' use an existing connection'
Best regards
Shong
----------------------------------------------------------
Talend | Data Agility for Modern Business
One Star

Re: Wrong character encoding in mysql result using characterSetResults prp

Hi,
I am using talend v 5.3, I have followed all the steps mentioned below.
i.e. added "useUnicode=true&characterEncoding=UTF-8" in the additional parameter of the mysql connection.
also tried "SET character_set_results = 'utf8', character_set_client = 'utf8', character_set_connection = 'utf8', character_set_database = 'utf8', character_set_server = 'utf8'" in the mysql row component but I am still facing this problem.
I was trying to use the traces debug and found that the strings are not getting converted to UTF-8 format.
Is this a problem in the v5.3 or have I missed anything in the above statements. Please check the attached images.
Regards,
Saabir

Calling Talend Open Studio Users

The first 100 community members completing the Open Studio survey win a $10 gift voucher.

Start the survey

2019 GARNER MAGIC QUADRANT FOR DATA INTEGRATION TOOL

Talend named a Leader.

Get your copy

OPEN STUDIO FOR DATA INTEGRATION

Kickstart your first data integration and ETL projects.

Download now

What’s New for Talend Summer ’19

Watch the recorded webinar!

Watch Now

Best Practices for Using Context Variables with Talend – Part 4

Pick up some tips and tricks with Context Variables

Blog

How Media Organizations Achieved Success with Data Integration

Learn how media organizations have achieved success with Data Integration

Read

Agile Data lakes & Analytics

Accelerate your data lake projects with an agile approach

Watch