Sweep all .cshtml files for encoding corruption; add pre-commit guard

Replace all corruption variants with HTML entities across 226 view files:
- 3-char UTF-8-as-Win1252 sequences (ae-corruption)
- Standalone smart/curly quotes that break C# Razor expressions
- Partially re-corrupted variants where the 3rd byte was normalised to ASCII

tools/Fix-Encoding.ps1: re-runnable sweep; uses [char] code points so the
script itself never contains a literal non-ASCII character; supports -DryRun

.githooks/pre-commit: blocks commits containing the ae-corruption byte
signature (xc3xa2xe2x82xac); git core.hooksPath = .githooks so the
hook is repo-committed and active for all future work on this machine.

Build clean; 225 unit tests pass.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-05-20 21:37:10 -04:00
parent 21b39161a3
commit a0bdd2b5b4
252 changed files with 1785 additions and 1633 deletions
@@ -239,7 +239,7 @@
}
else
{
<span class="text-muted"></span>
<span class="text-muted">&mdash;</span>
}
</td>
<td class="fw-semibold">@job.FinalPrice.ToString("C")</td>
@@ -267,7 +267,7 @@
{
<div class="card-footer bg-transparent d-flex justify-content-between align-items-center py-3 px-4">
<div class="text-muted small">
Showing @jobs.StartIndex@jobs.EndIndex of @jobs.TotalCount jobs
Showing @jobs.StartIndex&ndash;@jobs.EndIndex of @jobs.TotalCount jobs
</div>
<div class="d-flex align-items-center gap-3">
<div class="d-flex align-items-center gap-1">
@@ -399,7 +399,7 @@
}
else
{
<span class="text-muted"></span>
<span class="text-muted">&mdash;</span>
}
</td>
<td class="fw-semibold">@quote.Total.ToString("C")</td>
@@ -426,7 +426,7 @@
{
<div class="card-footer bg-transparent d-flex justify-content-between align-items-center py-3 px-4">
<div class="text-muted small">
Showing @quotes.StartIndex@quotes.EndIndex of @quotes.TotalCount quotes
Showing @quotes.StartIndex&ndash;@quotes.EndIndex of @quotes.TotalCount quotes
</div>
<div class="d-flex align-items-center gap-3">
<div class="d-flex align-items-center gap-1">
@@ -25,7 +25,7 @@
<a tabindex="0" class="help-icon" role="button"
data-bs-toggle="popover" data-bs-placement="right" data-bs-trigger="focus"
data-bs-title="Company Information"
data-bs-content="Company Name is used on quotes, invoices, and correspondence. Leave it blank for individual (non-business) customers. Customer Type controls which features are available Commercial customers get payment terms, credit limits, and pricing tier discounts; Individual customers are for simpler one-off work.">
data-bs-content="Company Name is used on quotes, invoices, and correspondence. Leave it blank for individual (non-business) customers. Customer Type controls which features are available &mdash; Commercial customers get payment terms, credit limits, and pricing tier discounts; Individual customers are for simpler one-off work.">
<i class="bi bi-question-circle"></i>
</a>
</div>
@@ -59,7 +59,7 @@
</h5>
<div class="alert alert-info alert-permanent py-2 px-3 mb-3" style="font-size:.875rem;">
<i class="bi bi-info-circle me-1"></i>
<strong>Required:</strong> At least one of Company Name, First Name, or Last Name and at least one of Email, Phone, or Mobile Phone.
<strong>Required:</strong> At least one of Company Name, First Name, or Last Name &mdash; and at least one of Email, Phone, or Mobile Phone.
</div>
<div class="row g-3">
<div class="col-md-6">
@@ -216,7 +216,7 @@
<a tabindex="0" class="help-icon" role="button"
data-bs-toggle="popover" data-bs-placement="right" data-bs-trigger="focus"
data-bs-title="Business Information"
data-bs-content="These fields govern billing and compliance. Payment Terms sets the default for invoices (e.g., Net 30 = payment due within 30 days). Credit Limit is a soft cap on outstanding balance the system will warn when exceeded. Tax Exempt removes tax from all invoices for this customer (upload the exemption certificate on the Edit page).">
data-bs-content="These fields govern billing and compliance. Payment Terms sets the default for invoices (e.g., Net 30 = payment due within 30 days). Credit Limit is a soft cap on outstanding balance &mdash; the system will warn when exceeded. Tax Exempt removes tax from all invoices for this customer (upload the exemption certificate on the Edit page).">
<i class="bi bi-question-circle"></i>
</a>
</div>
@@ -232,7 +232,7 @@
<a tabindex="0" class="help-icon" role="button"
data-bs-toggle="popover" data-bs-placement="right" data-bs-trigger="focus"
data-bs-title="Payment Terms"
data-bs-content="Sets the default due date on invoices for this customer. 'Net 30' means payment is due 30 days after the invoice date. This is a default you can override it on individual invoices.">
data-bs-content="Sets the default due date on invoices for this customer. 'Net 30' means payment is due 30 days after the invoice date. This is a default &mdash; you can override it on individual invoices.">
<i class="bi bi-question-circle"></i>
</a>
</div>
@@ -250,7 +250,7 @@
<div class="col-md-3">
<label asp-for="PricingTierId" class="form-label">Pricing Tier</label>
<select asp-for="PricingTierId" asp-items="ViewBag.PricingTiers" class="form-select">
<option value=""> No tier </option>
<option value="">&mdash; No tier &mdash;</option>
</select>
<small class="text-muted">Applies a discount to all quotes for this customer.</small>
</div>
@@ -1,4 +1,4 @@
@model PowderCoating.Application.DTOs.Customer.CustomerDto
@model PowderCoating.Application.DTOs.Customer.CustomerDto
@{
ViewData["Title"] = !string.IsNullOrWhiteSpace(Model.CompanyName)
@@ -123,7 +123,7 @@
}
else
{
<span class=text-muted>Not set &mdash; invoices go to contact email</span>
<span class="text-muted">Not set &mdash; invoices go to contact email</span>
}
</p>
</div>
@@ -531,7 +531,7 @@
<div class="mb-3">
<label class="form-label fw-semibold">Reason <span class="text-danger">*</span></label>
<select name="Reason" class="form-select" required id="creditReasonSelect">
<option value="">— Select reason —</option>
<option value="">&mdash; Select reason &mdash;</option>
<option value="Pre-payment / Deposit">Pre-payment / Deposit</option>
<option value="Gift / Gift Card">Gift / Gift Card</option>
<option value="Overpayment credit">Overpayment credit</option>
@@ -1,4 +1,4 @@
@model PowderCoating.Application.DTOs.Customer.UpdateCustomerDto
@model PowderCoating.Application.DTOs.Customer.UpdateCustomerDto
@{
ViewData["Title"] = "Edit Customer";
@@ -26,7 +26,7 @@
<a tabindex="0" class="help-icon" role="button"
data-bs-toggle="popover" data-bs-placement="right" data-bs-trigger="focus"
data-bs-title="Company Information"
data-bs-content="Company Name is used on quotes, invoices, and correspondence. Customer Type controls which features are available — Commercial customers get payment terms, credit limits, and pricing tier discounts. Status Inactive hides the customer from new quote/job dropdowns but preserves all history.">
data-bs-content="Company Name is used on quotes, invoices, and correspondence. Customer Type controls which features are available &mdash; Commercial customers get payment terms, credit limits, and pricing tier discounts. Status Inactive hides the customer from new quote/job dropdowns but preserves all history.">
<i class="bi bi-question-circle"></i>
</a>
</div>
@@ -220,7 +220,7 @@
<a tabindex="0" class="help-icon" role="button"
data-bs-toggle="popover" data-bs-placement="right" data-bs-trigger="focus"
data-bs-title="Business Information"
data-bs-content="Payment Terms sets the default due date on invoices (e.g., Net 30 = 30 days from invoice date). Credit Limit is a soft warning cap — the system alerts when exceeded. Tax Exempt removes tax from all invoices; upload the exemption certificate in the Tax Exempt Certificate section below.">
data-bs-content="Payment Terms sets the default due date on invoices (e.g., Net 30 = 30 days from invoice date). Credit Limit is a soft warning cap &mdash; the system alerts when exceeded. Tax Exempt removes tax from all invoices; upload the exemption certificate in the Tax Exempt Certificate section below.">
<i class="bi bi-question-circle"></i>
</a>
</div>
@@ -246,7 +246,7 @@
<div class="col-md-3">
<label asp-for="PricingTierId" class="form-label">Pricing Tier</label>
<select asp-for="PricingTierId" asp-items="ViewBag.PricingTiers" class="form-select">
<option value="">— No tier —</option>
<option value="">&mdash; No tier &mdash;</option>
</select>
<small class="text-muted">Applies a discount to all quotes for this customer.</small>
</div>
@@ -291,7 +291,7 @@
<a tabindex="0" class="help-icon" role="button"
data-bs-toggle="popover" data-bs-placement="right" data-bs-trigger="focus"
data-bs-title="Notification Preferences"
data-bs-content="Controls when the customer receives automatic updates. Email notifications send status change alerts (e.g., job ready for pickup) to the customer's email address. SMS requires separate TCPA consent — uncheck 'SMS Notifications Active' to temporarily pause without revoking consent.">
data-bs-content="Controls when the customer receives automatic updates. Email notifications send status change alerts (e.g., job ready for pickup) to the customer's email address. SMS requires separate TCPA consent &mdash; uncheck 'SMS Notifications Active' to temporarily pause without revoking consent.">
<i class="bi bi-question-circle"></i>
</a>
</div>
@@ -314,7 +314,7 @@
<div class="mt-3">
@if (Model.SmsConsentedAt.HasValue)
{
<!-- Consent already recorded — show status and allow pause/resume -->
<!-- Consent already recorded &mdash; show status and allow pause/resume -->
<div class="card border-success bg-success-subtle p-3 mb-2">
<div class="d-flex align-items-start gap-3">
<i class="bi bi-shield-fill-check text-success fs-4 mt-1"></i>
@@ -339,7 +339,7 @@
}
else
{
<!-- No consent on file — show the compliance notice and consent checkbox -->
<!-- No consent on file &mdash; show the compliance notice and consent checkbox -->
<div class="alert alert-warning border-warning alert-permanent" role="alert">
<h6 class="alert-heading fw-bold mb-2">
<i class="bi bi-exclamation-triangle-fill me-2"></i>SMS Consent Requirement (TCPA)
@@ -116,7 +116,7 @@
}
else
{
<span class="text-muted"></span>
<span class="text-muted">&mdash;</span>
}
</td>
<td>
@@ -128,7 +128,7 @@
}
else
{
<span class="text-muted"></span>
<span class="text-muted">&mdash;</span>
}
</td>
<td>
@@ -140,7 +140,7 @@
}
else
{
<span class="text-muted"></span>
<span class="text-muted">&mdash;</span>
}
</td>
<td>
@@ -224,7 +224,7 @@
}
<div class="mobile-card-row">
<span class="mobile-card-label">Phone</span>
<span class="mobile-card-value">@(customer.Phone ?? "")</span>
<span class="mobile-card-value">@(customer.Phone ?? "&mdash;")</span>
</div>
<div class="mobile-card-row">
<span class="mobile-card-label">Type</span>
@@ -102,7 +102,7 @@
}
else
{
<span class="text-muted"></span>
<span class="text-muted">&mdash;</span>
}
</td>
<td class="align-middle text-end fw-semibold">@inv.Total.ToString("C")</td>
@@ -1,12 +1,12 @@
@model PowderCoating.Application.DTOs.Accounting.CustomerStatementDto
@{
ViewData["Title"] = $"Statement {Model.CustomerName}";
ViewData["Title"] = $"Statement &ndash; {Model.CustomerName}";
}
<div class="d-flex justify-content-between align-items-start mb-4 flex-wrap gap-2">
<div>
<h4 class="mb-0">Customer Statement</h4>
<p class="text-muted mb-0">@Model.CustomerName &nbsp;·&nbsp; @Model.From.ToString("MMM d, yyyy") @Model.To.ToString("MMM d, yyyy")</p>
<p class="text-muted mb-0">@Model.CustomerName &nbsp;·&nbsp; @Model.From.ToString("MMM d, yyyy") &ndash; @Model.To.ToString("MMM d, yyyy")</p>
</div>
<div class="d-flex gap-2 flex-wrap">
<form method="get" class="d-flex gap-2 align-items-center">