cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

2024 Technology Preview Program:
Master powerful new features and shape the latest BIM-enabled innovations

Archicad C++ API
About Archicad add-on development using the C++ API.

[SOLVED] German letters not showing properly

Anonymous
Not applicable
Hello again,

I'm tryging to create a new attribute with name "Sto-Dämmplatte Top32", but the ä symbol seems to break like in the image bellow. What could be the possible reason for that? My code is something like that:

const char * name = vectorit->name.c_str();
                
strcpy (attrib.header.name, name);

Thanks in advance,
Julian C.

Screen Shot 2017-06-06 at 17.20.07.png
4 REPLIES 4
Ralph Wessel
Mentor
jcimentarov wrote:
I'm tryging to create a new attribute with name "Sto-Dämmplatte Top32", but the ä symbol seems to break like in the image bellow. What could be the possible reason for that? My code is something like that:

strcpy (attrib.header.name, name);
I think that's a text encoding problem. You probably want to set the attribute name using a GS::UniString, in which case you would set uniStringNamePtr rather than name in the attribute header. That should ensure the string encoding is correctly interpreted and preserved.
Ralph Wessel BArch
Software Engineer Speckle Systems
Anonymous
Not applicable

 GS::UniString uniName (vectorit->name.c_str());
                
 attrib.header.uniStringNamePtr = &uniName;
                
 WriteReport("uniname is %s", uniName.ToCStr().Get());
This is my code, but still when created in Archicad the name looks like this -"Sto-D√§mmplatte Top32". Strangely when I open my console.app it is logged as it should be: "uniname is Sto-Dämmplatte Top32"...

What else could it be? Just for the record I'm working on xcode 8.3.2
Ralph Wessel
Mentor
jcimentarov wrote:

 GS::UniString uniName (vectorit->name.c_str());
 
What is the encoding of vectorit->name? You need to pass the encoding type to the constructor of GS::Stringor it may interpret it incorrectly, e.g. if the encoding is UTF-8:

 GS::UniString uniName (vectorit->name.c_str(), CC_UTF8);
Ralph Wessel BArch
Software Engineer Speckle Systems
Anonymous
Not applicable
Thanks Ralph!!! Everything works perfect now. Issue resolved ))

Didn't find the answer?

Check other topics in this Forum

Back to Forum

Read the latest accepted solutions!

Accepted Solutions

Start a new conversation!