<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Convert GS::UChar_t to std::string in Archicad C++ API</title>
    <link>https://community.graphisoft.com/t5/Archicad-C-API/Convert-GS-UChar-t-to-std-string/m-p/364193#M1281</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm trying to convert GS::UChar_t to std::string, but i can't get it done.&lt;/P&gt;&lt;P&gt;Usually I use std::string(GS::ValueToString(value).ToCStr()) to convert a Value to string, but if a value is of type GS::UChar_t this method doesn't work.&lt;/P&gt;&lt;P&gt;Could anyone give me a quick work around?&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Kind Regards&lt;/P&gt;&lt;P&gt;Dayiz&lt;/P&gt;</description>
    <pubDate>Tue, 06 Dec 2022 16:48:17 GMT</pubDate>
    <dc:creator>Dayiz</dc:creator>
    <dc:date>2022-12-06T16:48:17Z</dc:date>
    <item>
      <title>Convert GS::UChar_t to std::string</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Convert-GS-UChar-t-to-std-string/m-p/364193#M1281</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm trying to convert GS::UChar_t to std::string, but i can't get it done.&lt;/P&gt;&lt;P&gt;Usually I use std::string(GS::ValueToString(value).ToCStr()) to convert a Value to string, but if a value is of type GS::UChar_t this method doesn't work.&lt;/P&gt;&lt;P&gt;Could anyone give me a quick work around?&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Kind Regards&lt;/P&gt;&lt;P&gt;Dayiz&lt;/P&gt;</description>
      <pubDate>Tue, 06 Dec 2022 16:48:17 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Convert-GS-UChar-t-to-std-string/m-p/364193#M1281</guid>
      <dc:creator>Dayiz</dc:creator>
      <dc:date>2022-12-06T16:48:17Z</dc:date>
    </item>
    <item>
      <title>Re: Convert GS::UChar_t to std::string</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Convert-GS-UChar-t-to-std-string/m-p/364245#M1282</link>
      <description>&lt;P&gt;I am use:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="cpp"&gt;std::string CvtAnsi(const GS::UniString&amp;amp; src)
{
	return src.ToCStr(0, MaxUSize, CC_System).Get(); // Системная кодировка
}

std::string CvtUtf8(const GS::UniString&amp;amp; src)
{
	return src.ToCStr(0, MaxUSize, CC_UTF8).Get();
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Convert unicode to ansi is not simple stuff, if used any not english language.&lt;BR /&gt;The function used System Code page.&lt;/P&gt;</description>
      <pubDate>Wed, 07 Dec 2022 03:43:34 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Convert-GS-UChar-t-to-std-string/m-p/364245#M1282</guid>
      <dc:creator>Oleg</dc:creator>
      <dc:date>2022-12-07T03:43:34Z</dc:date>
    </item>
    <item>
      <title>Re: Convert GS::UChar_t to std::string</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Convert-GS-UChar-t-to-std-string/m-p/364270#M1283</link>
      <description>&lt;P&gt;Hello Oleg,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Your methods made me notice, that I should just be able to&amp;nbsp;cast GS::Uchar_t to GS::UniString, which is possible and I ended up doing it like that.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you very much for your help &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Kind Regards&lt;/P&gt;&lt;P&gt;Dayiz&lt;/P&gt;</description>
      <pubDate>Wed, 07 Dec 2022 09:11:31 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Convert-GS-UChar-t-to-std-string/m-p/364270#M1283</guid>
      <dc:creator>Dayiz</dc:creator>
      <dc:date>2022-12-07T09:11:31Z</dc:date>
    </item>
  </channel>
</rss>

