diff --git a/common/string.cpp b/common/string.cpp index 7fd7ccd14f..b2959d0093 100644 --- a/common/string.cpp +++ b/common/string.cpp @@ -198,6 +198,7 @@ wxString UnescapeString( const wxString& aSource ) else if( token == wxS( "tab" ) ) newbuf.append( wxS( "\t" ) ); else if( token == wxS( "return" ) ) newbuf.append( wxS( "\n" ) ); else if( token == wxS( "brace" ) ) newbuf.append( wxS( "{" ) ); + else if( token.IsEmpty() ) newbuf.append( wxS( "{" ) ); else { newbuf.append( "{" + UnescapeString( token ) + "}" ); diff --git a/pcbnew/dialogs/dialog_text_properties.cpp b/pcbnew/dialogs/dialog_text_properties.cpp index e7840db698..34837418fa 100644 --- a/pcbnew/dialogs/dialog_text_properties.cpp +++ b/pcbnew/dialogs/dialog_text_properties.cpp @@ -28,6 +28,7 @@ #include #include #include +#include #include #include #include @@ -345,7 +346,9 @@ bool DIALOG_TEXT_PROPERTIES::TransferDataFromWindow() if( !m_MultiLineText->GetValue().IsEmpty() ) { BOARD* board = m_Parent->GetBoard(); - wxString txt = board->ConvertCrossReferencesToKIIDs( m_MultiLineText->GetValue() ); + wxString txt = EscapeString( + board->ConvertCrossReferencesToKIIDs( m_MultiLineText->GetValue() ), + CTX_QUOTED_STR ); // On Windows, a new line is coded as \r\n. // We use only \n in kicad files and in drawing routines.