Skip to content

fix(ui): repair two double-encoded UTF-8 strings in public/index.html - #71

Merged
blixvip merged 1 commit into
blixvip:mainfrom
hussain-alsaibai:fix/mojibake-encoding
Nov 15, 2026
Merged

blixvip merged 1 commit into
blixvip:mainfrom
hussain-alsaibai:fix/mojibake-encoding

Conversation

@hussain-alsaibai

Copy link
Copy Markdown
Contributor

Fixes #58.

Both spots are repaired in public/index.html:

  1. The Brand theme modal's close button (line 1254) read the mojibake label (U+00C3 U+2014) where the multiplication sign (U+00D7) was meant. It now matches the sibling modalX button at line 1101.
  2. The duration sniffer's separator class (line 3239) was the corrupt [-a-currency-quote-dash] sequence (U+00E2 U+20AC U+201C U+00E2 U+20AC U+201D), so the regex matched a, the euro sign and curly quotes as separators and did not match an en or em dash at all. It is now the escaped form [\-\u2013\u2014], which survives any future re-encoding.

The escaped form was chosen deliberately: the literal dashes would be re-corrupted by the same Latin-1 round-trip that produced the bug.

Verification

The check named in the issue now prints false:

node -e "const s=require('fs').readFileSync('public/index.html','utf8'); console.log([...s].some(c=>c.charCodeAt(0)===0xC3||c.charCodeAt(0)===0xE2))"
# false

And the separator now recognises all three dashes, where the old class did the opposite:

input old class new class
8 - seconds true true
8 - seconds (en dash) false true
8 - seconds (em dash) false true
8 - seconds (curly quote) true false

A codepoint census of the file confirms no U+00C3 or U+00E2 remain (both were 1 and 2 before; now 0). The correct multiplication sign and dashes already appear elsewhere in the same file, so this was two isolated spots rather than a file-wide encoding problem - a scan found only these two, as the issue recorded.

Test note

npm run check passes locally ("Checked 47 UI files; no personal companion URLs"). npm test has two failures in the audio-extraction tests (test/media.test.js, test/server.test.js): extractAudio reuses cached files and shares concurrent extraction and reference audio route extracts missing audio once and handles extraction failures. Both are pre-existing and unrelated - they need an ffmpeg build this container does not have, and I confirmed the identical 404 !== 200 failure with this change stashed, on unmodified main.

@blixvip
blixvip merged commit 2b4eca1 into blixvip:main Nov 15, 2026
1 check passed
@blixvip

blixvip commented Nov 15, 2026

Copy link
Copy Markdown
Owner

Merged, thanks @hussain-alsaibai! Using the escaped [\-–—] class was the smart part: a literal dash would just get mangled again by the next Latin-1 round-trip. I checked it here: 37/37 tests and npm run check pass, the mojibake scan prints false, and en and em dashes now match while curly quotes don't.

You already know the preview code from #66, so #68 (keep the preview Play/Pause button label in sync with the film) would be a natural next one. Comment there if you want it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix two double-encoded UTF-8 strings in public/index.html

2 participants