API: always serialize with UTF-8

(cherry picked from commit 1637a124ff)

Co-authored-by: Jon Evans <jon@craftyjon.com>
This commit is contained in:
Jon Evans
2026-03-15 22:03:42 -04:00
parent d6cc7faed4
commit ffa8fef0d3
2 changed files with 6 additions and 6 deletions
+3 -3
View File
@@ -189,14 +189,14 @@ void EDA_TEXT::Serialize( google::protobuf::Any &aContainer ) const
using namespace kiapi::common;
types::Text text;
text.set_text( GetText().ToStdString() );
text.set_hyperlink( GetHyperlink().ToStdString() );
text.set_text( GetText().ToUTF8() );
text.set_hyperlink( GetHyperlink().ToUTF8() );
PackVector2( *text.mutable_position(), GetTextPos() );
types::TextAttributes* attrs = text.mutable_attributes();
if( GetFont() )
attrs->set_font_name( GetFont()->GetName().ToStdString() );
attrs->set_font_name( GetFont()->GetName().ToUTF8() );
attrs->set_horizontal_alignment(
ToProtoEnum<GR_TEXT_H_ALIGN_T, types::HorizontalAlignment>( GetHorizJustify() ) );
+3 -3
View File
@@ -322,8 +322,8 @@ void FOOTPRINT::Serialize( google::protobuf::Any &aContainer ) const
def->mutable_id()->CopyFrom( kiapi::common::LibIdToProto( GetFPID() ) );
// anchor?
def->mutable_attributes()->set_description( GetLibDescription().ToStdString() );
def->mutable_attributes()->set_keywords( GetKeywords().ToStdString() );
def->mutable_attributes()->set_description( GetLibDescription().ToUTF8() );
def->mutable_attributes()->set_keywords( GetKeywords().ToUTF8() );
// TODO: serialize library mandatory fields
@@ -350,7 +350,7 @@ void FOOTPRINT::Serialize( google::protobuf::Any &aContainer ) const
wxStringTokenizer tokenizer( group, " " );
while( tokenizer.HasMoreTokens() )
netTie->add_pad_number( tokenizer.GetNextToken().ToStdString() );
netTie->add_pad_number( tokenizer.GetNextToken().ToUTF8() );
}
for( PCB_LAYER_ID layer : GetPrivateLayers().Seq() )