Allow unicode characters as userdata file is now written in UTF-8 by abulujayn · Pull Request #5861 · EssentialsX/Essentials

@abulujayn

Information

This PR fixes #1742.

Details

Proposed fix:
Allow unicode characters as userdata file is now encoded with UTF-8. (Remove safeString call)

Environments tested:

OS: Windows 11

Java version: Corretto-21.0.3.9.1

  • Most recent Paper version (1.21-40-master@b45d9b6)
  • CraftBukkit/Spigot/Paper 1.12.2
  • CraftBukkit 1.8.8

Demonstration:
image

@abulujayn

JRoy

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The problem with this is that previously special chars were replaced with an underscore, if you remove this method call players may be confused if they use a special char and it suddenly not resolve to the correct warp.

@abulujayn

The problem with this is that previously special chars were replaced with an underscore, if you remove this method call players may be confused if they use a special char and it suddenly not resolve to the correct warp.

Sorry, I don't understand what you mean. Before this change, using special characters would be replaced with underscores âpple -> _pple. Now it will no longer be replaced, where would the confusion occur? Wouldn't it cause less confusion?

@mdcfe

This will break players trying to teleport to homes they saved prior to the change, as those will no longer be found when running an identical /home command after the change. This isn't necessarily a reason to reject this PR, but there needs to be some contingency so that players can find their old homes (and possibly re-create them).

@abulujayn

This will break players trying to teleport to homes they saved prior to the change, as those will no longer be found when running an identical /home command after the change. This isn't necessarily a reason to reject this PR, but there needs to be some contingency so that players can find their old homes (and possibly re-create them).

Am I misunderstanding? I thought the way it worked was: /sethome âpple would create a home named _pple. Players then had to use /home _pple to teleport to it. After this change, the home would still be called _pple and can be teleported to using /home _pple if created before the update. I don't see any conversion to "safe" string when fetching the home so I don't see the issue so either I'm blind or missing something, or both 😂