Eeschema Eagle Import: support UTF-8 for fields

This commit is contained in:
Maciej Suminski 2017-10-18 13:10:06 +02:00
parent b77ba486ec
commit 0ed7483868
2 changed files with 4 additions and 8 deletions

View File

@ -103,7 +103,7 @@ long long int ECOORD::ToNanoMeters( int aValue, enum UNIT aUnit )
template<>
string Convert<string>( const wxString& aValue )
{
return aValue.ToStdString();
return string( aValue.ToUTF8() );
}

View File

@ -1075,13 +1075,9 @@ void SCH_EAGLE_PLUGIN::loadInstance( wxXmlNode* aInstanceNode )
component->AddHierarchicalReference( current_sheetpath, wxString( einstance.part ), unit );
if( epart->value )
{
component->GetField( VALUE )->SetText( *epart->value );
}
component->GetField( VALUE )->SetText( wxString::FromUTF8( epart->value->c_str() ) );
else
{
component->GetField( VALUE )->SetText( symbolname );
}
// Set the visibility of fields.
component->GetField( REFERENCE )->SetVisible( part->GetField( REFERENCE )->IsVisible() );
@ -1102,9 +1098,9 @@ void SCH_EAGLE_PLUGIN::loadInstance( wxXmlNode* aInstanceNode )
SCH_FIELD* field;
if( attr.name == "NAME" || attr.name == "VALUE" )
if( attr.name == "name" || attr.name == "value" )
{
if( attr.name == "NAME" )
if( attr.name == "name" )
{
field = component->GetField( REFERENCE );
nameAttributeFound = true;