I'm writing a script in Groovy that needs to store (and later retrieve) data which contains czech characters (such as č, š, í, ě, ...).
I use a standard JDBC connection like
def sql = Sql.newInstance(
'jdbc:mysql://localhost/db',
'root',
'',
'com.mysql.jdbc.Driver'
);
sql.executeInsert(
'INSERT INTO ... VALUES ...', [ ... ]
);
I have downloaded the latest MySQL ZIP archive for 64bit Windows machines and extracted it on my local hard drive. I now run it (for testing purposes) via mysqld
launched manually from the command line.
When I store and retrieve the data some of the czech symbols are corrupted (?s are displayed instead of them). I believe that the database works with a wrong encoding. I would prefer the script to work with UTF-8 encoded data.
I have found a lot of (mutually different) information on the internet about how to set MySQL to work with UTF-8 data. Non of them worked for me, though.
Could you please provide instructions for my specific use case?