Five Stars Moe
Five Stars

Reading and inserting arabic

Hi,

 

Im reading from AS400 one arabic field and inserting it into mysql DB, but it seems Im only getting gibberish with qestion marks?

 

Note: I tried to add into the (additional JDBC parameters) this string (useUnicode=true&characterEncoding=utf8) with no luck....

 

 

Hope someone could help. 

5 REPLIES
Six Stars

Re: Reading and inserting arabic

hi

Your Mysql db also should accept UTF-8 characters. alter your table which field you need to load arabic data.

for your reference please see below query.

 

ALTER TABLE `database`.`table` MODIFY COLUMN col VARCHAR(255)
CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL;

Five Stars Moe
Five Stars

Re: Reading and inserting arabic

Already done, with no luck
Five Stars Moe
Five Stars

Re: Reading and inserting arabic

When using encoding cp1256 the display is ??? with some weird characters, while when using encoding utf8 the display is gibberish (only wired characters) .. Note that the AS400 file Im reading from has CCSID = 37
Moderator

Re: Reading and inserting arabic

Hello,

Have you also tried to add  the "Dfile.encoding=utf-8" to the JVM parameters to see if it works?

utf-8.png

 

Best regards

Sabrina

--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.
Five Stars Moe
Five Stars

Re: Reading and inserting arabic

Actually when I changed the CCSID to 420 on AS400 the encoding to cp1256 worked. It is weird that it does not work with the CCSID is 37