From 97f3c323c39b9fd13efe4af5f340f84f9103a0b1 Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Sun, 27 Dec 2020 10:18:23 +0100 Subject: [PATCH] Pcbnew: fix missing escaping of texts in DIMENSION when saving the .kicad_pcb file. Fixes #6855 https://gitlab.com/kicad/code/kicad/issues/6855 --- pcbnew/plugins/kicad/kicad_plugin.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/pcbnew/plugins/kicad/kicad_plugin.cpp b/pcbnew/plugins/kicad/kicad_plugin.cpp index 1379404334..770967cac0 100644 --- a/pcbnew/plugins/kicad/kicad_plugin.cpp +++ b/pcbnew/plugins/kicad/kicad_plugin.cpp @@ -714,17 +714,18 @@ void PCB_IO::format( DIMENSION_BASE* aDimension, int aNestLevel ) const m_out->Print( aNestLevel + 1, "(format" ); if( !aDimension->GetPrefix().IsEmpty() ) - m_out->Print( 0, " (prefix \"%s\")", TO_UTF8( aDimension->GetPrefix() ) ); + m_out->Print( 0, " (prefix %s)", m_out->Quotew( aDimension->GetPrefix() ).c_str() ); if( !aDimension->GetSuffix().IsEmpty() ) - m_out->Print( 0, " (suffix \"%s\")", TO_UTF8( aDimension->GetSuffix() ) ); + m_out->Print( 0, " (suffix %s)", m_out->Quotew( aDimension->GetSuffix() ).c_str() ); m_out->Print( 0, " (units %d) (units_format %d) (precision %d)", static_cast( aDimension->GetUnitsMode() ), static_cast( aDimension->GetUnitsFormat() ), aDimension->GetPrecision() ); if( aDimension->GetOverrideTextEnabled() ) - m_out->Print( 0, " (override_value \"%s\")", TO_UTF8( aDimension->GetOverrideText() ) ); + m_out->Print( 0, " (override_value %s)", + m_out->Quotew( aDimension->GetOverrideText() ).c_str() ); if( aDimension->GetSuppressZeroes() ) m_out->Print( 0, " suppress_zeroes" );