<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://community.arm.com/utility/feedstylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Using fwprintf</title><link>https://community.arm.com/developer/tools-software/tools/f/keil-forum/25236/using-fwprintf</link><description> 
Hi! 

 
I am using 2-byte wide char strings in my application. Strings
should be written and read from file (in flash FS). When using
fwprintf(), i got in file only one byte per character, like
converting UTF-8 to plain ASCII. 

 
Here&amp;#39;s my simple example</description><dc:language>en-US</dc:language><generator>Telligent Community 10</generator><item><title>RE: Using fwprintf</title><link>https://community.arm.com/thread/56241?ContentTypeID=1</link><pubDate>Tue, 09 Jun 2009 05:22:24 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:45ad1e28-4df1-4852-bb35-c41916c819a3</guid><dc:creator>Marko Pavlin</dc:creator><description>&lt;p&gt;&lt;p&gt;
I made some further tests. I put some simple wchars:&lt;/p&gt;

&lt;pre&gt;
// 0100;LATIN CAPITAL LETTER A WITH MACRON;Lu;0;L;0041 0304;;;;N;LATIN CAPITAL LETTER A MACRON;;;0101;
                fputwc(0x0100, fout);

//03B1;GREEK SMALL LETTER ALPHA;Ll;0;L;;;;;N;;;0391;;0391
                fputwc(0x03b1, fout);
&lt;/pre&gt;

&lt;p&gt;
But those two chars are not in file at all. The char is written to
file as one-byte only when wchar is &amp;lt; 0x00ff.&lt;/p&gt;

&lt;p&gt;
And...the function&lt;/p&gt;

&lt;pre&gt;
fwide (fout, 1);
&lt;/pre&gt;

&lt;p&gt;
&lt;br /&gt;
returns 1.&lt;/p&gt;

&lt;p&gt;
I really don&amp;#39;t know what I am doing wrong. I read 
&lt;a href="http://infocenter.arm.com/help/topic/com.arm.doc.dui0349a/DUI0349A_rvct_libraries_guide.pdf"&gt;infocenter.arm.com/.../DUI0349A_rvct_libraries_guide.pdf&lt;/a&gt;
and some other manuals.&lt;/p&gt;

&lt;p&gt;
Marko&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Using fwprintf</title><link>https://community.arm.com/thread/56227?ContentTypeID=1</link><pubDate>Tue, 09 Jun 2009 05:22:22 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:c2b0190d-787b-4e99-b0de-e328419ca395</guid><dc:creator>Robert &amp;#160;</dc:creator><description>&lt;p&gt;&lt;p&gt;
Wide characters are converted to multibyte representation when
written to a file. This requires selecting proper locale which can be
done at link time or at runtime.&lt;/p&gt;

&lt;p&gt;
The easiest way is to select the UTF-8 multibyte encoding by
adding the following into your code:&lt;/p&gt;

&lt;pre&gt;
#pragma import(__use_utf8_ctype)
&lt;/pre&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>