diff --git a/app/features/badges/homemade.json b/app/features/badges/homemade.json index d2075b027..6c8882c40 100644 --- a/app/features/badges/homemade.json +++ b/app/features/badges/homemade.json @@ -1204,7 +1204,7 @@ "authorDiscordId": "338806780446638082" }, "torneoes": { - "displayName": "PEÑA Tournament", + "displayName": "PEÑA Tournament", "authorDiscordId": "752582395076673577" }, "tralalero": { diff --git a/scripts/check-homemade-badges.ts b/scripts/check-homemade-badges.ts index c34d28ce4..4894e8321 100644 --- a/scripts/check-homemade-badges.ts +++ b/scripts/check-homemade-badges.ts @@ -35,7 +35,7 @@ for (const key of Object.keys(badges)) { lastKey = key; } -// check for duplicate displayName values +// check for duplicate displayName values and encoding issues const displayNames = new Map(); for (const [key, badge] of Object.entries(badges)) { const existingKey = displayNames.get(badge.displayName); @@ -46,6 +46,14 @@ for (const [key, badge] of Object.entries(badges)) { process.exit(1); } displayNames.set(badge.displayName, key); + + // check for Unicode replacement characters (encoding issues) + if (badge.displayName.includes("\uFFFD")) { + console.error( + `Invalid encoding in displayName for badge "${key}": contains replacement character (�). This usually means the file was saved with incorrect encoding.`, + ); + process.exit(1); + } } // check each key has the 3 matching files in the right location