Codex/fix song info display issues l5kval#315
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| val suspiciousPatterns = listOf("Ã", "â", "�", "ð", "Ÿ") | ||
| val needsFix = suspiciousPatterns.any { trimmed.contains(it) } | ||
|
|
||
| val reencoded = if (needsFix) { | ||
| runCatching { | ||
| String(trimmed.toByteArray(WINDOWS_1252), Charsets.UTF_8).trim() | ||
| }.getOrNull() |
There was a problem hiding this comment.
Avoid re-encoding legitimate ð/Ÿ metadata
The new normalizeMetadataText marks any string containing "ð" or "Ÿ" as corrupt and forces a Windows‑1252→UTF‑8 conversion. These letters are common in valid names (e.g. Icelandic or French metadata) and will be mangled because their UTF‑16 representation is reinterpreted as Windows‑1252 bytes and decoded as UTF‑8, yielding replacement characters. Previously the code left such text untouched; after this change, correct titles or artists are corrupted whenever they legitimately contain these characters. Consider detecting actual mis‑decoding patterns (like "Ã�", "ß", etc.) instead of individual letters, or gating the conversion behind stronger heuristics.
Useful? React with 👍 / 👎.
No description provided.