Hi Lukas,

I have a similar issue, and it looks like a JDBC bug:
https://bugs.mysql.com/bug.php?id=80631

The 6.0.5 release log claims they've solved the issue, but the problem 
still applies to normal VARCHAR columns.
I tried converting the table from latin1 to utf8mb4, changing the 
characterSetResults to latin1, then utf8, but nothing works.

The only thing that works is using ResultSet.getBytes instead of getString:

  new String(res.getBytes("columnName"), "UTF-8")

Is there any way I can get JOOQ to use getBytest instead of getString?

Thanks,
Daniel


jOOQ just passes Strings through to JDBC and fetches them from JDBC without 
> interfering with encoding. So, I suspect this may be related to the JDBC 
> driver settings. MySQL knows JDBC driver properties such as:
>
>    - characterEncoding
>    - characterSetResults
>    - connectionCollation
>    
> More information here:
>
> https://dev.mysql.com/doc/connector-j/8.0/en/connector-j-reference-configuration-properties.html
>
> Does that help?
>
> 2017-07-20 11:14 GMT+02:00 <[email protected] <javascript:>>:
>
>> Hi,
>>
>> I have a mysql database where all of its content are encoded as latin1, 
>> when I fetch the data it tries to convert to utf8 and it messes up 
>> everything.
>> The best way we got to solve this was with this ugly line of code:
>>
>>
>> content = Field( 
>>
>> "convert(cast(convert(" + TABLE_NAME + ".content using latin1) as 
>> binary) using utf8)",
>> String.class So, is there a better way to do this?
>>  Thanks, David 
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "jOOQ User Group" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to [email protected] <javascript:>.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
You received this message because you are subscribed to the Google Groups "jOOQ 
User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to