Garbled UTF-8 characters in MySQL shared database


#1

Hi all,

I’m having a problem storing UTF-8 characters in a MySQL shared database.

According to the JabRef manual, the database connection should be UTF-8 (non-configurable, but it’s what I want).

In the JabRef table, my entries look fine.

However, in the MySQL database, characters seem to be stored the wrong way. I only get question marks (both with the mysql client and with my php web application):

mysql> select * from FIELD where ENTRY_SHARED_ID=201;
+-----------------+-----------+------------------------------------------------------+
| ENTRY_SHARED_ID | NAME      | VALUE                                                |
+-----------------+-----------+------------------------------------------------------+
|             201 | address   | Beijing                                              |
|             201 | author    | [???] Fushu Liao                                     |
|             201 | bibtexkey | LiaoF.2008                                           |
|             201 | booktitle | ???? ????? ??? ?????????????                         |
|             201 | editor    | [???] Liao Chongxiang and [???] Huang Xudong         |
|             201 | pages     | 238-239                                              |
|             201 | series    | Zhongguo jinxiandai yinyueshi jiaoxue cankao wenxian |
|             201 | title     | ??? “???” [Haydn’s “Die Schöpfung”]                  |
|             201 | volume    | 2                                                    |
|             201 | year      | 2008                                                 |
+-----------------+-----------+------------------------------------------------------+

As far as I can see, my database is configured correctly. It’s utf8mb4 charset and utf8mb4_german2_ci collation everywhere:

mysql> show create table FIELD;
| FIELD | CREATE TABLE `FIELD` (
`ENTRY_SHARED_ID` int(11) NOT NULL,
`NAME` varchar(255) COLLATE utf8mb4_german2_ci NOT NULL,
`VALUE` text COLLATE utf8mb4_german2_ci,
KEY `ENTRY_SHARED_ID` (`ENTRY_SHARED_ID`),
CONSTRAINT `FIELD_ibfk_1` FOREIGN KEY (`ENTRY_SHARED_ID`) REFERENCES `ENTRY`
(`SHARED_ID`) ON DELETE CASCADE) 
ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_german2_ci |

Any ideas?

Regards,
Robert


(Christoph) #2

Hi,

please try the latest development version of JabRef, there has been a driver update of MySQL.
https://builds.jabref.org/master/