diff --git a/EtchBendLines b/EtchBendLines index 3c1700c..da4d322 160000 --- a/EtchBendLines +++ b/EtchBendLines @@ -1 +1 @@ -Subproject commit 3c1700c480bd8b1ba6d95c52d65ba9af694a6825 +Subproject commit da4d3228b0eede73a665b0a814f7b8ac818bcc94 diff --git a/ExportDXF/Services/PartExporter.cs b/ExportDXF/Services/PartExporter.cs index f7522ad..eb314f7 100644 --- a/ExportDXF/Services/PartExporter.cs +++ b/ExportDXF/Services/PartExporter.cs @@ -307,6 +307,7 @@ namespace ExportDXF.Services { var etcher = new EtchBendLines.Etcher(); etcher.AddEtchLines(dxfPath); + FixDegreeSymbol(dxfPath); } catch (Exception) { @@ -314,6 +315,20 @@ namespace ExportDXF.Services } } + /// + /// ACadSharp misreads the UTF-8 degree symbol (C2 B0) as two ANSI_1252 + /// characters (°). Fix it in the written DXF so bend notes display correctly. + /// + private static void FixDegreeSymbol(string path) + { + var text = System.IO.File.ReadAllText(path); + if (text.Contains("\u00C2\u00B0")) + { + text = text.Replace("\u00C2\u00B0", "\u00B0"); + System.IO.File.WriteAllText(path, text); + } + } + private string GetSinglePartFileName(ModelDoc2 model, string prefix) { var title = model.GetTitle().Replace(".SLDPRT", "");