diff --git a/common/string_utils.cpp b/common/string_utils.cpp index 6b972e7e3c..0d1ae757f5 100644 --- a/common/string_utils.cpp +++ b/common/string_utils.cpp @@ -159,9 +159,12 @@ wxString EscapeString( const wxString& aSource, ESCAPE_CONTEXT aContext ) else converted += c; } - else if( aContext == CTX_LIBID ) + else if( aContext == CTX_LIBID || aContext == CTX_LEGACY_LIBID ) { - if( c == '\\' ) + // We no longer escape '/' in LIB_IDs, but we used to + if( c == '/' && aContext == CTX_LEGACY_LIBID ) + converted += wxT( "{slash}" ); + else if( c == '\\' ) converted += wxT( "{backslash}" ); else if( c == '<' ) converted += wxT( "{lt}" ); diff --git a/eeschema/sch_plugins/kicad/sch_sexpr_plugin.cpp b/eeschema/sch_plugins/kicad/sch_sexpr_plugin.cpp index 29d1e529c7..3486ef8c63 100644 --- a/eeschema/sch_plugins/kicad/sch_sexpr_plugin.cpp +++ b/eeschema/sch_plugins/kicad/sch_sexpr_plugin.cpp @@ -1493,6 +1493,10 @@ LIB_SYMBOL* SCH_SEXPR_PLUGIN::LoadSymbol( const wxString& aLibraryPath, const wx LIB_SYMBOL_MAP::const_iterator it = m_cache->m_symbols.find( aSymbolName ); + // We no longer escape '/' in symbol names, but we used to. + if( it == m_cache->m_symbols.end() && aSymbolName.Contains( '/' ) ) + it = m_cache->m_symbols.find( EscapeString( aSymbolName, CTX_LEGACY_LIBID ) ); + if( it == m_cache->m_symbols.end() ) return nullptr; diff --git a/include/string_utils.h b/include/string_utils.h index e18b1dc6b2..664649addc 100644 --- a/include/string_utils.h +++ b/include/string_utils.h @@ -53,6 +53,7 @@ enum ESCAPE_CONTEXT { CTX_NETNAME, CTX_LIBID, + CTX_LEGACY_LIBID, CTX_IPC, CTX_QUOTED_STR, CTX_JS_STR,