From 2b33abab2612028b216ceb96f68e0bf09c60ef4f Mon Sep 17 00:00:00 2001 From: nexariton <198056267+nexariton@users.noreply.github.com> Date: Thu, 13 Nov 2025 16:11:41 +0100 Subject: [PATCH] fix: replace umlaut characters with ASCII equivalents in cleanTitle (#481) Update the cleanTitle() function in utils.ts to replace umlaut characters with their ASCII transliterations --- packages/core/src/parser/utils.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/core/src/parser/utils.ts b/packages/core/src/parser/utils.ts index ca252bff..5341a3df 100644 --- a/packages/core/src/parser/utils.ts +++ b/packages/core/src/parser/utils.ts @@ -84,7 +84,11 @@ export function normaliseTitle(title: string) { } export function cleanTitle(title: string) { - let cleaned = title.normalize('NFD'); + const umlautMap: Record = { + 'Ä':'Ae','ä':'ae','Ö':'Oe','ö':'oe','Ü':'Ue','ü':'ue','ß':'ss' + }; + // replace German umlauts with ASCII equivalents, then normalize to NFD + let cleaned = title.replace(/[ÄäÖöÜüß]/g, c => umlautMap[c]).normalize('NFD'); for (const char of ['♪', '♫', '★', '☆', '♡', '♥', '-']) { cleaned = cleaned.replaceAll(char, ' ');