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
@@ -2,7 +2,7 @@
@using PowderCoating.Core.Enums
@model Company
@{
ViewData["Title"] = $"Manage {Model.CompanyName}";
ViewData["Title"] = $"Manage &ndash; {Model.CompanyName}";
var planConfigs = (dynamic)ViewBag.PlanConfigs;
string PlanName(int plan)
@@ -66,9 +66,9 @@
<dt class="col-7 text-muted">Users</dt>
<dd class="col-5 fw-semibold">@ViewBag.UserCount</dd>
<dt class="col-7 text-muted">Stripe Customer</dt>
<dd class="col-5"><code class="small">@(Model.StripeCustomerId ?? "")</code></dd>
<dd class="col-5"><code class="small">@(Model.StripeCustomerId ?? "&mdash;")</code></dd>
<dt class="col-7 text-muted">Stripe Sub</dt>
<dd class="col-5"><code class="small">@(Model.StripeSubscriptionId ?? "")</code></dd>
<dd class="col-5"><code class="small">@(Model.StripeSubscriptionId ?? "&mdash;")</code></dd>
</dl>
</div>
</div>
@@ -99,7 +99,7 @@
<form method="post" asp-action="UpdateSubscription" asp-route-id="@Model.Id">
@Html.AntiForgeryToken()
@* Comped / Internal card prominent *@
@* Comped / Internal card &mdash; prominent *@
<div class="card border-0 shadow-sm mb-3 @(Model.IsComped ? "border-success border-2" : "")">
<div class="card-header border-0 py-3 @(Model.IsComped ? "bg-success bg-opacity-10" : "bg-white")">
<h6 class="mb-0 fw-semibold">
@@ -351,11 +351,11 @@
</div>
<dl class="row small mb-3">
<dt class="col-5 text-muted">Invoice</dt>
<dd class="col-7 font-monospace" id="refund-invoice-number"></dd>
<dd class="col-7 font-monospace" id="refund-invoice-number">&mdash;</dd>
<dt class="col-5 text-muted">Amount Paid</dt>
<dd class="col-7 fw-semibold" id="refund-amount-paid"></dd>
<dd class="col-7 fw-semibold" id="refund-amount-paid">&mdash;</dd>
<dt class="col-5 text-muted">Max Refundable</dt>
<dd class="col-7 fw-semibold text-success" id="refund-max-amount"></dd>
<dd class="col-7 fw-semibold text-success" id="refund-max-amount">&mdash;</dd>
</dl>
<div class="mb-3">
<label class="form-label fw-medium">Refund Amount</label>
@@ -402,7 +402,7 @@
@section Scripts {
<script>
// ── State for the refund modal ────────────────────────────────────────────────
// -- State for the refund modal ------------------------------------------------
let _refundPaymentIntentId = null;
let _refundMaxCents = 0;
let _refundAmountPaid = '';
@@ -442,7 +442,7 @@ async function loadPaymentHistory() {
: '';
const refundedCell = ch.amountRefunded
? `<span class="text-danger small">${ch.amountRefunded}</span>`
: '<span class="text-muted small"></span>';
: '<span class="text-muted small">&mdash;</span>';
const desc = ch.description ? `<span class="text-muted">${ch.description}</span>` : `<code class="small">${ch.id}</code>`;
// Show Refund button only for succeeded charges that still have something refundable
@@ -469,7 +469,7 @@ async function loadPaymentHistory() {
}
function openRefundModal(chargeId, refundableCents, amountPaid, displayLabel) {
_refundPaymentIntentId = chargeId; // reusing variable now holds charge ID
_refundPaymentIntentId = chargeId; // reusing variable &mdash; now holds charge ID
_refundMaxCents = refundableCents;
_refundAmountPaid = amountPaid;
_refundInvoiceNumber = displayLabel;
@@ -509,7 +509,7 @@ async function submitRefund() {
}
submitBtn.disabled = true;
submitBtn.innerHTML = '<span class="spinner-border spinner-border-sm me-1"></span>Processing';
submitBtn.innerHTML = '<span class="spinner-border spinner-border-sm me-1"></span>Processing&hellip;';
try {
const formData = new FormData();