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
@@ -1,7 +1,7 @@
@using PowderCoating.Core.Entities
@model StripeWebhookEvent
@{
ViewData["Title"] = $"Webhook Event {Model.EventId}";
ViewData["Title"] = $"Webhook Event &ndash; {Model.EventId}";
var statusClass = Model.Status switch
{
StripeWebhookEventStatus.Processed => "success",
@@ -35,7 +35,7 @@
<dd class="col-7"><span class="badge bg-light text-dark border">@Model.EventType</span></dd>
<dt class="col-5 text-muted">Company ID</dt>
<dd class="col-7">@(Model.CompanyId.HasValue ? Model.CompanyId.ToString() : "")</dd>
<dd class="col-7">@(Model.CompanyId.HasValue ? Model.CompanyId.ToString() : "&mdash;")</dd>
<dt class="col-5 text-muted">Status</dt>
<dd class="col-7"><span class="badge bg-@statusClass">@Model.Status</span></dd>
@@ -44,7 +44,7 @@
<dd class="col-7">@Model.ReceivedAt.ToString("MM/dd/yyyy HH:mm:ss") UTC</dd>
<dt class="col-5 text-muted">Processed At</dt>
<dd class="col-7">@(Model.ProcessedAt.HasValue ? Model.ProcessedAt.Value.ToString("MM/dd/yyyy HH:mm:ss") + " UTC" : "")</dd>
<dd class="col-7">@(Model.ProcessedAt.HasValue ? Model.ProcessedAt.Value.ToString("MM/dd/yyyy HH:mm:ss") + " UTC" : "&mdash;")</dd>
</dl>
</div>
</div>
@@ -145,12 +145,12 @@
<td class="small">
<span class="badge bg-secondary-subtle text-body border">@evt.EventType</span>
</td>
<td class="small">@(evt.CompanyId.HasValue ? $"#{evt.CompanyId}" : "")</td>
<td class="small">@(evt.CompanyId.HasValue ? $"#{evt.CompanyId}" : "&mdash;")</td>
<td>
<span class="badge bg-@statusClass">@evt.Status</span>
</td>
<td class="small">
@(evt.ProcessedAt.HasValue ? evt.ProcessedAt.Value.ToString("HH:mm:ss") : "")
@(evt.ProcessedAt.HasValue ? evt.ProcessedAt.Value.ToString("HH:mm:ss") : "&mdash;")
</td>
<td>
<a asp-action="Details" asp-route-id="@evt.Id" class="btn btn-outline-secondary btn-sm py-0">View</a>
@@ -160,7 +160,7 @@
</tbody>
</table>
</div>
<!-- Mobile card view shown on screens < 992px -->
<!-- Mobile card view &mdash; shown on screens < 992px -->
<div class="mobile-card-view">
<div class="mobile-card-list">
@if (!Model.Any())
@@ -191,11 +191,11 @@
</div>
<div class="mobile-card-row">
<span class="mobile-card-label">Company</span>
<span class="mobile-card-value">@(evt.CompanyId.HasValue ? $"#{evt.CompanyId}" : "")</span>
<span class="mobile-card-value">@(evt.CompanyId.HasValue ? $"#{evt.CompanyId}" : "&mdash;")</span>
</div>
<div class="mobile-card-row">
<span class="mobile-card-label">Event ID</span>
<span class="mobile-card-value text-muted small font-monospace">@(evt.EventId?.Length > 20 ? evt.EventId.Substring(0, 20) + "" : evt.EventId)</span>
<span class="mobile-card-value text-muted small font-monospace">@(evt.EventId?.Length > 20 ? evt.EventId.Substring(0, 20) + "&hellip;" : evt.EventId)</span>
</div>
</div>
<div class="mobile-card-footer">