From 3c1700c480bd8b1ba6d95c52d65ba9af694a6825 Mon Sep 17 00:00:00 2001 From: AJ Isaacs Date: Thu, 19 Feb 2026 16:28:38 -0500 Subject: [PATCH] fix: repair double-encoded degree symbol in DXF output MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ACadSharp misreads UTF-8 degree symbol (C2 B0) as two ANSI_1252 characters (°) then writes that back out. Post-process the saved DXF to replace ° with ° so bend notes display correctly. Co-Authored-By: Claude Opus 4.6 --- EtchBendLines/Etcher.cs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/EtchBendLines/Etcher.cs b/EtchBendLines/Etcher.cs index af620d2..ef99e73 100644 --- a/EtchBendLines/Etcher.cs +++ b/EtchBendLines/Etcher.cs @@ -86,9 +86,22 @@ namespace EtchBendLines { writer.Write(); } + + FixDegreeSymbol(path); + Console.WriteLine($"→ Saved with etch lines: {path}"); } + private static void FixDegreeSymbol(string path) + { + var text = File.ReadAllText(path); + if (text.Contains("\u00C2\u00B0")) + { + text = text.Replace("\u00C2\u00B0", "\u00B0"); + File.WriteAllText(path, text); + } + } + private static string KeyFor(Line l) => KeyFor(l.StartPoint, l.EndPoint); private static string KeyFor(XYZ a, XYZ b) => $"{a.X:F3},{a.Y:F3}|{b.X:F3},{b.Y:F3}";