Reporter

Reporter

148k Downloads

Error saving cyrrilic text in MySQL

Yabzik opened this issue ยท 1 comments

commented

Describe the bug
I used to use a plugin with SQLite and the cyrillic text was saved normally. After I configured the connection to MySQL, the report description text after saving turns into question marks. The table in the database by default uses the encoding utf8mb4_general_ci. I tried using latin1 and utf8_general_ci, but I get the same result.

To Reproduce

  1. Configure MySQL connection
  2. Report any user with cyrillic text in description
  3. Try to view report description from the game or check record in database directly

Expected behavior
Get the submitted description

Screenshots
If applicable, add screenshots to help explain your problem.

Server Information:

  • Server: Spigot
  • Version: 1.15.2

Reporter Information (please complete the following information):

  • Version: 3.3.3
  • Database Engine: MySQL
commented

I believe there are a few things going on with this issue.

  1. Like you mentioned, the tables and columns need to use the utf8mb4 character set and a matching collation.
  2. The JDBC connection to the database needs to be be updated to encode the data using utf8. More than likely this is why even after changing the database the text was still getting scrambled.

Both of these issues have been fixed and are just waiting for the next release. When you run the plugin for the first time with the new release it should automatically update your tables and columns to utf8mb4. So, you shouldn't have to do anything for this to start working.