diff --git a/eeschema/sch_plugins/legacy/sch_legacy_plugin.cpp b/eeschema/sch_plugins/legacy/sch_legacy_plugin.cpp index a7f72b6513..ad680f5cf8 100644 --- a/eeschema/sch_plugins/legacy/sch_legacy_plugin.cpp +++ b/eeschema/sch_plugins/legacy/sch_legacy_plugin.cpp @@ -2727,7 +2727,6 @@ void SCH_LEGACY_PLUGIN_CACHE::loadDocs() aliasName = wxString::FromUTF8( line ); aliasName.Trim(); - // aliasName = EscapeString( aliasName, CTX_LIBID ); LIB_SYMBOL_MAP::iterator it = m_symbols.find( aliasName ); @@ -2834,6 +2833,7 @@ LIB_SYMBOL* SCH_LEGACY_PLUGIN_CACHE::LoadPart( LINE_READER& aReader, int aMajorV wxString name, prefix, tmp; name = tokens.GetNextToken(); + name = EscapeString( name, CTX_LIBID ); pos += name.size() + 1; prefix = tokens.GetNextToken(); @@ -3071,6 +3071,11 @@ void SCH_LEGACY_PLUGIN_CACHE::loadField( std::unique_ptr& aSymbol, parseQuotedString( text, aReader, line, &line, true ); + // The value field needs to be "special" escaped. The other fields are + // escaped normally and don't need special handling + if( id == VALUE_FIELD ) + text = EscapeString( text, CTX_QUOTED_STR ); + // Doctor the *.lib file field which has a "~" in blank fields. New saves will // not save like this. if( text.size() == 1 && text[0] == '~' )