<?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 Re: GS::UniString can't support chinese in Archicad C++ API</title>
    <link>https://community.graphisoft.com/t5/Archicad-C-API/GS-UniString-can-t-support-chinese/m-p/266210#M3155</link>
    <description>Hi,&lt;BR /&gt;
&lt;BR /&gt;
I recommend you to read this: &lt;A href="https://docs.microsoft.com/en-us/cpp/cpp/string-and-character-literals-cpp" target="_blank"&gt;&lt;LINK_TEXT text="https://docs.microsoft.com/en-us/cpp/cp ... terals-cpp"&gt;https://docs.microsoft.com/en-us/cpp/cpp/string-and-character-literals-cpp&lt;/LINK_TEXT&gt;&lt;/A&gt;&lt;BR /&gt;
To summarize it I quote the most relevant parts of the article:
&lt;BLOCKQUOTE&gt;String literals can have no prefix, or u8, L, u, and U prefixes to denote narrow character (single-byte or multi-byte), UTF-8, wide character (UCS-2 or UTF-16), UTF-16 and UTF-32 encodings...
&lt;PRE&gt;    // String literals
    auto s0 =   "hello"; // const char*
    auto s1 = u8"hello"; // const char*, encoded as UTF-8
    auto s2 =  L"hello"; // const wchar_t*
    auto s3 =  u"hello"; // const char16_t*, encoded as UTF-16
    auto s4 =  U"hello"; // const char32_t*, encoded as UTF-32&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;
So if you want to make sure that your string literal will be encoded as UTF-8, then you should use u8 perfix.&lt;BR /&gt;
Try this:
&lt;PRE&gt;ACAPI_WriteReport(u8"你好");&lt;/PRE&gt;</description>
    <pubDate>Wed, 23 Oct 2019 08:59:57 GMT</pubDate>
    <dc:creator>Tibor Lorantfy</dc:creator>
    <dc:date>2019-10-23T08:59:57Z</dc:date>
    <item>
      <title>GS::UniString can't support chinese</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/GS-UniString-can-t-support-chinese/m-p/266209#M3154</link>
      <description>&lt;DIV class="actalk-migrated-content"&gt;Hi.&lt;BR /&gt;When I want to use ACAPI_WriteReport ,I find that it can't print chinese. &lt;BR /&gt;Character garbled occurs. e.g:&lt;BR /&gt;ACAPI_WriteReport("你好，你好！"); it will show '??????????'.&lt;BR /&gt;&lt;BR /&gt;My default char code is UTF8.How should I solve the problem?&lt;/DIV&gt;</description>
      <pubDate>Thu, 29 Sep 2022 08:06:29 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/GS-UniString-can-t-support-chinese/m-p/266209#M3154</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-09-29T08:06:29Z</dc:date>
    </item>
    <item>
      <title>Re: GS::UniString can't support chinese</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/GS-UniString-can-t-support-chinese/m-p/266210#M3155</link>
      <description>Hi,&lt;BR /&gt;
&lt;BR /&gt;
I recommend you to read this: &lt;A href="https://docs.microsoft.com/en-us/cpp/cpp/string-and-character-literals-cpp" target="_blank"&gt;&lt;LINK_TEXT text="https://docs.microsoft.com/en-us/cpp/cp ... terals-cpp"&gt;https://docs.microsoft.com/en-us/cpp/cpp/string-and-character-literals-cpp&lt;/LINK_TEXT&gt;&lt;/A&gt;&lt;BR /&gt;
To summarize it I quote the most relevant parts of the article:
&lt;BLOCKQUOTE&gt;String literals can have no prefix, or u8, L, u, and U prefixes to denote narrow character (single-byte or multi-byte), UTF-8, wide character (UCS-2 or UTF-16), UTF-16 and UTF-32 encodings...
&lt;PRE&gt;    // String literals
    auto s0 =   "hello"; // const char*
    auto s1 = u8"hello"; // const char*, encoded as UTF-8
    auto s2 =  L"hello"; // const wchar_t*
    auto s3 =  u"hello"; // const char16_t*, encoded as UTF-16
    auto s4 =  U"hello"; // const char32_t*, encoded as UTF-32&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;
So if you want to make sure that your string literal will be encoded as UTF-8, then you should use u8 perfix.&lt;BR /&gt;
Try this:
&lt;PRE&gt;ACAPI_WriteReport(u8"你好");&lt;/PRE&gt;</description>
      <pubDate>Wed, 23 Oct 2019 08:59:57 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/GS-UniString-can-t-support-chinese/m-p/266210#M3155</guid>
      <dc:creator>Tibor Lorantfy</dc:creator>
      <dc:date>2019-10-23T08:59:57Z</dc:date>
    </item>
    <item>
      <title>Re: GS::UniString can't support chinese</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/GS-UniString-can-t-support-chinese/m-p/266211#M3156</link>
      <description>Thanks.</description>
      <pubDate>Thu, 24 Oct 2019 03:42:36 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/GS-UniString-can-t-support-chinese/m-p/266211#M3156</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-10-24T03:42:36Z</dc:date>
    </item>
  </channel>
</rss>

