diff --git a/common/libraries/lib_table_grid_data_model.cpp b/common/libraries/lib_table_grid_data_model.cpp index 332f176698..a5533d29a8 100644 --- a/common/libraries/lib_table_grid_data_model.cpp +++ b/common/libraries/lib_table_grid_data_model.cpp @@ -225,18 +225,18 @@ void LIB_TABLE_GRID_DATA_MODEL::SetValue( int aRow, int aCol, const wxString& aV if( badCoords( aRow, aCol ) ) return; - LIBRARY_TABLE_ROW& r = at( aRow ); + LIBRARY_TABLE_ROW& lrow = at( aRow ); switch( aCol ) { - case COL_NICKNAME: r.SetNickname( EscapeString( aValue, CTX_LIBID ) ); break; - case COL_URI: r.SetURI( aValue ); break; - case COL_TYPE: r.SetType( aValue ); break; - case COL_OPTIONS: r.SetOptions( aValue ); break; - case COL_DESCR: r.SetDescription( aValue ); break; - case COL_ENABLED: r.SetDisabled( aValue == wxT( "0" ) ); break; - case COL_VISIBLE: r.SetHidden( aValue == wxT( "0" ) ); break; - case COL_STATUS: break; + case COL_NICKNAME: lrow.SetNickname( EscapeString( aValue, CTX_LIBID ) ); break; + case COL_URI: lrow.SetURI( aValue ); break; + case COL_TYPE: lrow.SetType( aValue ); break; + case COL_OPTIONS: lrow.SetOptions( aValue ); break; + case COL_DESCR: lrow.SetDescription( aValue ); break; + case COL_ENABLED: lrow.SetDisabled( aValue == wxT( "0" ) ); break; + case COL_VISIBLE: lrow.SetHidden( aValue == wxT( "0" ) ); break; + case COL_STATUS: break; } if( aCol == COL_URI || aCol == COL_TYPE || aCol == COL_OPTIONS ) diff --git a/eeschema/tools/sch_edit_table_tool.cpp b/eeschema/tools/sch_edit_table_tool.cpp index 73a9d69e5e..8648552ffe 100644 --- a/eeschema/tools/sch_edit_table_tool.cpp +++ b/eeschema/tools/sch_edit_table_tool.cpp @@ -27,7 +27,7 @@ #include #include #include - +#include SCH_EDIT_TABLE_TOOL::SCH_EDIT_TABLE_TOOL() : SCH_TOOL_BASE( "eeschema.TableEditor" ) diff --git a/libs/sexpr/sexpr_parser.cpp b/libs/sexpr/sexpr_parser.cpp index cb767ef18d..d2b0b8a5ce 100644 --- a/libs/sexpr/sexpr_parser.cpp +++ b/libs/sexpr/sexpr_parser.cpp @@ -62,7 +62,21 @@ namespace SEXPR // the filename is not always a UTF7 string, so do not use ifstream // that do not work with unicode chars. + #if defined( __MINGW32__ ) + // On msys2 currently using From_UTF8( defined in string_utils.cpp) creates a link + // issue. (From_UTF8() undefined symbol). So redefine it here (duplicate) for now. + wxString fname( wxString::FromUTF8( aFileName.c_str() ) ); + + if( fname.IsEmpty() ) // happens when aString is not a valid UTF8 sequence + { + fname = wxConvCurrent->cMB2WC( aFileName.c_str() ); // try to use locale conversion + + if( fname.IsEmpty() ) + fname = wxString::From8BitData( aFileName.c_str() ); // try to use native string + } + #else wxString fname( From_UTF8( aFileName.c_str() ) ); + #endif wxFFile file( fname, "rb" ); size_t length = file.Length(); diff --git a/pcbnew/pcb_tablecell.cpp b/pcbnew/pcb_tablecell.cpp index e5dccb7c62..d88891b0a7 100644 --- a/pcbnew/pcb_tablecell.cpp +++ b/pcbnew/pcb_tablecell.cpp @@ -29,7 +29,7 @@ #include #include #include -#include +#include PCB_TABLECELL::PCB_TABLECELL( BOARD_ITEM* aParent ) :