<?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: 2byte Unicode in KDS3.2  /wchar_t in Kinetis Design Studio</title>
    <link>https://community.nxp.com/t5/Kinetis-Design-Studio/2byte-Unicode-in-KDS3-2-wchar-t/m-p/564559#M7221</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jennie,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am afraid that you are right.&lt;/P&gt;&lt;P&gt;My problem is, that I need to convert existig CW project to KDS.&lt;/P&gt;&lt;P&gt;The project has a lot of code included 2byte strings in Flash, od SDHC card and&lt;/P&gt;&lt;P&gt;on the "other side" of USB. It is not simple to convert all of them.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Jaroslav&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 18 Jul 2016 11:20:19 GMT</pubDate>
    <dc:creator>jaroslavbrazdil</dc:creator>
    <dc:date>2016-07-18T11:20:19Z</dc:date>
    <item>
      <title>2byte Unicode in KDS3.2  /wchar_t</title>
      <link>https://community.nxp.com/t5/Kinetis-Design-Studio/2byte-Unicode-in-KDS3-2-wchar-t/m-p/564557#M7219</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;BR /&gt;Hi,&lt;/P&gt;&lt;P&gt;I want to use 2 byte Unicode in my KDS3.2 / SDK 2.0project .&lt;/P&gt;&lt;P&gt;I have found this : &lt;A _jive_internal="true" data-containerid="11213" data-containertype="14" data-objectid="382585" data-objecttype="1" href="https://community.nxp.com/thread/382585"&gt;Unicode support in KDS3.0?&lt;/A&gt; &lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;and I set my compile parametr for GCC&amp;nbsp;&amp;nbsp;&amp;nbsp; (Properties /&amp;nbsp; C/C++ Build / Cross ARM C Compiler / Miscellanous / other compiler flags):&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #51626f; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;-fshort-wchar&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;It can generate 2 byte unicode strings.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;Is it possible to use functions from wchar.h&amp;nbsp;&amp;nbsp; as&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;swprintf, (wchar_t *__restrict, size_t,&amp;nbsp; const wchar_t *__restrict, ...);&amp;nbsp; ?&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When I try to use &lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; wchar_t buf[20];&lt;/P&gt;&lt;P&gt;&amp;nbsp; swprintf(buf, 20, L"%ls", L"XAHOJ123456");&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;the buffer buf[20] is set as 2byte,&lt;/P&gt;&lt;P&gt;the functin use buf as 4byte , the buf is overloaded in the swprintf()&lt;/P&gt;&lt;P&gt;and a hard fault error ocure.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Have I use other library, or copile the library somehow?&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank You,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Jaroslav&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Jul 2016 08:55:02 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Design-Studio/2byte-Unicode-in-KDS3-2-wchar-t/m-p/564557#M7219</guid>
      <dc:creator>jaroslavbrazdil</dc:creator>
      <dc:date>2016-07-13T08:55:02Z</dc:date>
    </item>
    <item>
      <title>Re: 2byte Unicode in KDS3.2  /wchar_t</title>
      <link>https://community.nxp.com/t5/Kinetis-Design-Studio/2byte-Unicode-in-KDS3-2-wchar-t/m-p/564558#M7220</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;from what I know KDS doesn't have other replacement function for swprintf.&lt;/P&gt;&lt;P&gt;I think the only "fix" is to use 4bytes buf for swprintf.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Have a great day,&lt;BR /&gt;Jennie Zhang&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-----------------------------------------------------------------------------------------------------------------------&lt;BR /&gt;Note: If this post answers your question, please click the Correct Answer button. Thank you!&lt;BR /&gt;-----------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 Jul 2016 07:39:59 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Design-Studio/2byte-Unicode-in-KDS3-2-wchar-t/m-p/564558#M7220</guid>
      <dc:creator>ZhangJennie</dc:creator>
      <dc:date>2016-07-18T07:39:59Z</dc:date>
    </item>
    <item>
      <title>Re: 2byte Unicode in KDS3.2  /wchar_t</title>
      <link>https://community.nxp.com/t5/Kinetis-Design-Studio/2byte-Unicode-in-KDS3-2-wchar-t/m-p/564559#M7221</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jennie,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am afraid that you are right.&lt;/P&gt;&lt;P&gt;My problem is, that I need to convert existig CW project to KDS.&lt;/P&gt;&lt;P&gt;The project has a lot of code included 2byte strings in Flash, od SDHC card and&lt;/P&gt;&lt;P&gt;on the "other side" of USB. It is not simple to convert all of them.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Jaroslav&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 Jul 2016 11:20:19 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Design-Studio/2byte-Unicode-in-KDS3-2-wchar-t/m-p/564559#M7221</guid>
      <dc:creator>jaroslavbrazdil</dc:creator>
      <dc:date>2016-07-18T11:20:19Z</dc:date>
    </item>
  </channel>
</rss>

