[CONJ-592] update of UTF8 text column gives error Created: 2018-03-29  Updated: 2020-03-06  Resolved: 2020-03-06

Status: Closed
Project: MariaDB Connector/J
Component/s: configuration
Affects Version/s: 2.2.1
Fix Version/s: N/A

Type: Bug Priority: Major
Reporter: Robert Dyas Assignee: Diego Dupin
Resolution: Incomplete Votes: 0
Labels: None
Environment:

centos7 server 10.2.13



 Description   

I've never experienced a problem with an exotic character saving to Mariadb before, but this trips up the JDBC driver prepared statement:

actually when i paste in the example, it shows correctly here but jira prevents me from saving it; it might be a strange 4 byte character possibly as follows (commonly used in email being copied and pasted into a text field as html):

😊

The smiley face encoded as a UTF8 string causes the following error:

(conn=78522) Incorrect string value: '\xF0\x9F\x98\x8A</...' for column 'comments' at row 1) #1366 (TransactionSet.java:1050)
java.sql.SQLDataException: (conn=78522) Incorrect string value: '\xF0\x9F\x98\x8A</...' for column 'comments' at row 1



 Comments   
Comment by Diego Dupin [ 2019-09-13 ]

sorry for late answer, but this probably relate to Having a server configured in utf8, not utf8mb4.
see https://mariadb.com/kb/en/library/setting-character-sets-and-collations/

MariaDB default configuration might use 3 bytes utf8 or 4 bytes (real) utf8 depending on plateform.

Comment by Diego Dupin [ 2020-03-06 ]

Closing since no answer

Generated at Thu Feb 08 03:16:53 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.