From 352ed480a8d0e144a9301302afd64fde54f5fd69 Mon Sep 17 00:00:00 2001 From: Martin Date: Mon, 25 May 2026 21:26:43 +0200 Subject: [PATCH] =?UTF-8?q?Fix:=20PGN-Encoding=20(UTF-8/Latin-1=20Fallback?= =?UTF-8?q?=20f=C3=BCr=20Umlaute)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- js/app.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/js/app.js b/js/app.js index f0852e8..243b2e6 100644 --- a/js/app.js +++ b/js/app.js @@ -22,7 +22,13 @@ let updateTimer = null; async function fetchRoundPGN(round) { const res = await fetch(`https://www.deutsche-schachjugend.de/2026/odjm-d/partien/${round}.pgn?t=${Date.now()}`); if (!res.ok) return null; - return await res.text(); + const buf = await res.arrayBuffer(); + // DSJ liefert ISO-8859-1; versuche UTF-8, fallback auf Latin-1 + let text = new TextDecoder('utf-8').decode(buf); + if (text.includes('\uFFFD')) { + text = new TextDecoder('iso-8859-1').decode(buf); + } + return text; } async function loadPGN(showOverlay = true) {