The Global ARCHICAD Community

Stay informed. Get help. Share your knowledge.

Discussions about using GRAPHISOFT's tools (API DevKit) for independent software developers

Moderators: Karl Ottenstein, LaszloNagy, ejrolon, Barry Kelly, gkmethy, MOREH Tamas, Akos Somorjai, Ed Brown, Mihály Palenik, Tibor Lorántfy

By Hugo Willaume

I've recently been struggling with utf-8 encoding in ArchiCAD :
I am trying to create a Text Element in the scene, but my text is UTF8. I tried converting the text, playing around with GS::UniString and the CH family of functions, but so far nothing worked.

I even wonder if it is actually possible, as the API_ElementMemo->textContent is just a pointer to char * ? I am not experienced at all with encoding issues, so any help is welcome !

Thanks !
Alright, it was easy once I got a little less ArchiCAD specific in my searches, I feel ashamed !

It is as simple as declaring your strings as
Code: Select allstd::string str = u8"Whatever you want to input àéï" ;
, and work done, the u8 before your string does all the work, no need for a GS::Unistring or anything else.

Hope it will help someone !