WorldGuard

WorldGuard

8M Downloads

Message with mysql will convert to ?????????

LadyCailinBot opened this issue · 5 comments

commented

WORLDGUARD-3386 - Reported by Tony

reproduce step:

  1. Switch plugin storage to mysql.
  2. rg f global greeting 測試
  3. See it's behavior.

Here is result:
mysql will not correctly storage unicode string, it will display like "??"

I have tried following solution and all failed:

  1. Manually change table collation to "utf8_unicode_ci"
  2. Try following command:
    rg f global greeting \u6E2C\u8A66
    rg f global greeting '\u6E2C\u8A66'
    rg f global greeting "\u6E2C\u8A66"
  3. Manually change value to \u6E2C\u8A66, '\u6E2C\u8A66' and "\u6E2C\u8A66"
    Some of those solution will temporarily work, but all failed when server restart.

version info:
[Server thread/INFO]: This server is running CraftBukkit version git-Spigot-c46583f-e6f9fd4 (MC: 1.8) (Implementing API version 1.8-R0.1-SNAPSHOT)
[Server thread/INFO]: [WorldGuard] Loading WorldGuard v6.0.0-beta-05.1569-

commented

Comment by Tony

I found some case when manually change value to "\u6E2C\u8A66" will work for a long time.

I will try to find reason why some value like "\u6E2C\u8A66" were change to ?? when server restart.

commented

Comment by sk89q

Does it also look like ?? in the database after WG saves the data?

commented

Comment by Tony

if set with command "/rg f global greeting 測試", both ingame and database display ??

commented

Comment by Tony

I found reason why value will change back to ?? again when I was changed value manually.
Here is reproduce step:

  1. /rg f global deny-message 測試
  2. /worldguard reload (because value in database is ??)
  3. Manually change value to 測試 in database.
  4. /worldguard reload (after this step, both ingame and database will display correct value)
  5. Change some flag like /rg f global build allow
  6. /worldguard reload
  7. Value in database was change to ?? again.

If you don't change any flag after manually change message value, it will display correct for a long time.

commented

Comment by Tony

I was wrong, there is a only one format can work after server restart:
Manually change mysql value to "\u6E2C\u8A66"

if use color, you can't use & or § you need to use "\u00A7"

& doesn't work
§ will cause all unicode char in same value turn to ?