mirror of
https://github.com/rickbarrette/simple-aircraft-manager-rails.git
synced 2026-11-17 23:50:36 -05:00
Declare UTF-8 in HTML layouts; byte order mark on packaged CSVs
Packaged HTML opened from disk had no charset, so browsers guessed Windows-1252 and em dashes showed as mojibake; Excel does the same with CSVs that lack a BOM. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
5471b9317f
commit
350914bddc
5 files changed
+10
-2
No files matched your search
@@ -37,7 +37,10 @@ class RecordsPackage
|
||||
|
||||
private
|
||||
|
||||
# CSVs start with a UTF-8 byte order mark so Excel reads accents, dashes
|
||||
# and quotes correctly (without it, it guesses another encoding).
|
||||
def add(zip, name, content)
|
||||
content = "\uFEFF#{content}" if name.end_with?(".csv") && !content.start_with?("\uFEFF")
|
||||
zip.put_next_entry(name)
|
||||
zip.write(content)
|
||||
end
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
<!DOCTYPE html>
|
||||
<html class="h-full bg-page">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<%= render "shared/theme_script" %>
|
||||
<title><%= [content_for(:title), "Simple Aircraft Manager"].compact.join(" · ") %></title>
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1">
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
<!DOCTYPE html>
|
||||
<html class="h-full bg-page">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<%= render "shared/theme_script" %>
|
||||
<title><%= [content_for(:title), "Simple Aircraft Manager"].compact.join(" · ") %></title>
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1">
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
<!DOCTYPE html>
|
||||
<html class="bg-white" data-theme="light">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title><%= [content_for(:title), "Simple Aircraft Manager"].compact.join(" · ") %></title>
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1">
|
||||
<meta name="robots" content="noindex, nofollow">
|
||||
|
||||
Reference in new issue
Block a user