Declare UTF-8 for the stylesheet and served text types

style.css uses non-ASCII glyphs in CSS content (panel arrow, pin). Without a
declared encoding the browser can fall back to Latin-1 for the stylesheet and
render them as mojibake, which happened once in the preview. @charset at the
top of style.css fixes it everywhere; serve.py also sends charset=utf-8 for
html/css/js/json.

Co-Authored-By: Claude Fable 5 <[email protected]>
This commit is contained in:
lucioandClaude Fable 5 committed 2026-08-22 11:31:43 -07:00
1 parent 08c8445ba1
commit f7cd4fde04
2 files changed
+9 -1

No files matched your search

+8 -1
View File
@@ -42,7 +42,14 @@ CONFIG_LOCK = threading.Lock()
class Handler(http.server.SimpleHTTPRequestHandler):
extensions_map = {**http.server.SimpleHTTPRequestHandler.extensions_map,
".webp": "image/webp"}
".webp": "image/webp",
# Explicit charset: style.css carries non-ASCII glyphs
# (arrow, pin) and a stylesheet without a declared
# encoding can fall back to Latin-1 and render mojibake.
".html": "text/html; charset=utf-8",
".css": "text/css; charset=utf-8",
".js": "text/javascript; charset=utf-8",
".json": "application/json; charset=utf-8"}
editable = False
# SimpleHTTPRequestHandler defaults to HTTP/1.0, which closes the socket
+1
View File
@@ -1,3 +1,4 @@
@charset "UTF-8";
:root {
--bg: #14161a;
--panel: #1e2229ee;