diff --git a/common/string.cpp b/common/string.cpp index 8932fbc187..d0375c55af 100644 --- a/common/string.cpp +++ b/common/string.cpp @@ -515,10 +515,11 @@ bool ReplaceIllegalFileNameChars( wxString& aName, int aReplaceChar ) bool changed = false; wxString result; result.reserve( aName.Length() ); + wxString illWChars = GetIllegalFileNameWxChars(); for( wxString::iterator it = aName.begin(); it != aName.end(); ++it ) { - if( strchr( illegalFileNameChars, *it ) ) + if( illWChars.Find( *it ) != wxNOT_FOUND ) { if( aReplaceChar ) result += aReplaceChar; diff --git a/eeschema/libedit.cpp b/eeschema/libedit.cpp index 51630e861e..287f4f7f25 100644 --- a/eeschema/libedit.cpp +++ b/eeschema/libedit.cpp @@ -296,6 +296,7 @@ void LIB_EDIT_FRAME::OnCreateNewPart( wxCommandEvent& event ) } wxString name = dlg.GetName(); + // Currently, symbol names cannot include a space, that breaks libraries: name.Replace( " ", "_" ); // Test if there is a component with this name already.