SOLVED!
Create an UTF-8 API_TextType element
Anonymous
Not applicable
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2018-07-10
01:39 PM
- last edited on
‎2022-12-06
01:29 PM
by
Daniel Kassai
‎2018-07-10
01:39 PM
Hi!
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 !
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 !
Solved! Go to Solution.
Labels:
- Labels:
-
Add-On (C++)
1 ACCEPTED SOLUTION
Accepted Solutions
Solution
Anonymous
Not applicable
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2018-07-11 11:13 AM
‎2018-07-11
11:13 AM
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
Hope it will help someone !
It is as simple as declaring your strings as
std::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 !
1 REPLY 1
Solution
Anonymous
Not applicable
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2018-07-11 11:13 AM
‎2018-07-11
11:13 AM
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
Hope it will help someone !
It is as simple as declaring your strings as
std::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 !