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
@@ -67,7 +67,7 @@
<input type="hidden" name="tab" value="@activeTab" id="filterTabInput" />
<label class="form-label mb-0 fw-semibold me-1">Filter by Manufacturer:</label>
<select name="manufacturer" class="form-select form-select-sm w-auto" onchange="this.form.submit()">
<option value=""> All Manufacturers </option>
<option value="">&mdash; All Manufacturers &mdash;</option>
@foreach (var mfr in manufacturers)
{
<option value="@mfr" selected="@(selectedMfr == mfr ? "selected" : null)">@mfr</option>
@@ -244,9 +244,9 @@
<div class="text-muted small">@item.Name</div>
}
</td>
<td>@(item.Manufacturer ?? "")</td>
<td class="text-muted small">@(item.ManufacturerPartNumber ?? "")</td>
<td>@(item.Finish ?? "")</td>
<td>@(item.Manufacturer ?? "&mdash;")</td>
<td class="text-muted small">@(item.ManufacturerPartNumber ?? "&mdash;")</td>
<td>@(item.Finish ?? "&mdash;")</td>
<td>
@if (item.QuantityOnHand > 0)
{
@@ -260,7 +260,7 @@
<td class="text-end pe-3">
<button class="btn btn-sm btn-outline-success me-1 btn-toggle-panel"
data-item-id="@item.Id" data-has-panel="true"
title="Mark as received panel is on wall">
title="Mark as received &mdash; panel is on wall">
<i class="bi bi-check-lg me-1"></i>Got It
</button>
<a asp-action="Details" asp-route-id="@item.Id"
@@ -399,13 +399,13 @@
<div class="text-muted small">@item.Name</div>
}
</td>
<td>@(item.Manufacturer ?? "")</td>
<td class="text-muted small">@(item.ManufacturerPartNumber ?? "")</td>
<td>@(item.Finish ?? "")</td>
<td>@(item.Manufacturer ?? "&mdash;")</td>
<td class="text-muted small">@(item.ManufacturerPartNumber ?? "&mdash;")</td>
<td>@(item.Finish ?? "&mdash;")</td>
<td class="text-end pe-3">
<button class="btn btn-sm btn-outline-danger me-1 btn-toggle-panel"
data-item-id="@item.Id" data-has-panel="false"
title="Remove panel no longer on wall">
title="Remove &mdash; panel no longer on wall">
<i class="bi bi-x-lg me-1"></i>Remove
</button>
<a asp-action="Details" asp-route-id="@item.Id"
@@ -426,7 +426,7 @@
<!-- Print-only need-to-order output -->
<div id="printArea" style="display:none;">
<h3 style="font-family:sans-serif;">Sample Panels Need to Order</h3>
<h3 style="font-family:sans-serif;">Sample Panels &mdash; Need to Order</h3>
@if (!string.IsNullOrWhiteSpace(selectedMfr))
{
<p style="font-family:sans-serif;font-size:.9rem;color:#666;">Manufacturer: @selectedMfr</p>
@@ -461,7 +461,7 @@
<td style="border:1px solid #ccc;padding:6px 10px;">@(item.Manufacturer ?? "")</td>
<td style="border:1px solid #ccc;padding:6px 10px;">@(item.ManufacturerPartNumber ?? "")</td>
<td style="border:1px solid #ccc;padding:6px 10px;">@(item.Finish ?? "")</td>
<td style="border:1px solid #ccc;padding:6px 10px;">@(item.QuantityOnHand > 0 ? item.QuantityOnHand.ToString("N2") + " " + item.UnitOfMeasure : "")</td>
<td style="border:1px solid #ccc;padding:6px 10px;">@(item.QuantityOnHand > 0 ? item.QuantityOnHand.ToString("N2") + " " + item.UnitOfMeasure : "&mdash;")</td>
<td style="border:1px solid #ccc;padding:6px 10px;">&nbsp;</td>
</tr>
}