DynamicSurroundingsFabric icon indicating copy to clipboard operation
DynamicSurroundingsFabric copied to clipboard

Properly escaping unicode in fabric.mod.json

Open PerikiyoXD opened this issue 3 years ago • 1 comments

Project fabric.mod.json

{
  "schemaVersion": 1,
  "id": "dsurround",
  "version": "${version}",
  "name": "\u00a76Dynamic Surroundings\u00a7r: \u00a7eFabric Edition",
...

Output fabric.mod.json (jar)

{
  "schemaVersion": 1,
  "id": "dsurround",
  "version": "0.0.4",
  "name": "§6Dynamic Surroundings§r: §eFabric Edition",
...

As you can see, name escapes \u00a76 into § when resources are processed.

To fix the issue:

build.gradle:

     filesMatching("fabric.mod.json") {
-        expand "version": project.version
+        expand (version: project.version) {
+            escapeBackslash = true
+        }
     }

PerikiyoXD avatar May 10 '22 04:05 PerikiyoXD

This work has been done over fork/branch for 1.18.2. Extrapolates to this repo as well.

PerikiyoXD avatar May 10 '22 04:05 PerikiyoXD

Fixing up various json files to use the unicode escape. Will show up in the 1.20.4 update.

OreCruncher avatar Dec 16 '23 14:12 OreCruncher

Pushed 1.20.4 update to Modrinth and CurseForge (though Curse is going to take a bit to be available).

OreCruncher avatar Dec 16 '23 21:12 OreCruncher