<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Writing UTF-8 files in C++</title>
	<atom:link href="http://mariusbancila.ro/blog/2008/10/20/writing-utf-8-files-in-c/feed/" rel="self" type="application/rss+xml" />
	<link>http://mariusbancila.ro/blog/2008/10/20/writing-utf-8-files-in-c/</link>
	<description>Sharing my opinions and ideas!</description>
	<lastBuildDate>Fri, 05 Mar 2010 05:38:46 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Silviu</title>
		<link>http://mariusbancila.ro/blog/2008/10/20/writing-utf-8-files-in-c/comment-page-1/#comment-32844</link>
		<dc:creator>Silviu</dc:creator>
		<pubDate>Fri, 22 Jan 2010 07:53:19 +0000</pubDate>
		<guid isPermaLink="false">http://mariusbancila.ro/blog/?p=135#comment-32844</guid>
		<description>Sorin, if you&#039;re using _wfopen() with css=UTF-8, you automatically add BOM chars to the file beginning. The BOM should create more disadvantages then advantages. 
For instance, if you open again the same file created with the same parameters (just to change your file content) then you must be careful to remove the old BOM chars section, because otherwise you have two BOMs. :D 
I met this situation in the past into a bug of one of my colleges and it isnâ€™t to pretty.
I use std::ofstream class and a class conversion that contains a similarly conversion method, Mariusâ€™s sample.</description>
		<content:encoded><![CDATA[<p>Sorin, if you&#8217;re using _wfopen() with css=UTF-8, you automatically add BOM chars to the file beginning. The BOM should create more disadvantages then advantages.<br />
For instance, if you open again the same file created with the same parameters (just to change your file content) then you must be careful to remove the old BOM chars section, because otherwise you have two BOMs. <img src='http://mariusbancila.ro/blog/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /><br />
I met this situation in the past into a bug of one of my colleges and it isnâ€™t to pretty.<br />
I use std::ofstream class and a class conversion that contains a similarly conversion method, Mariusâ€™s sample.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Collation, DateTime, SParse Column and XML : Unicode References</title>
		<link>http://mariusbancila.ro/blog/2008/10/20/writing-utf-8-files-in-c/comment-page-1/#comment-27641</link>
		<dc:creator>Collation, DateTime, SParse Column and XML : Unicode References</dc:creator>
		<pubDate>Wed, 20 May 2009 05:01:40 +0000</pubDate>
		<guid isPermaLink="false">http://mariusbancila.ro/blog/?p=135#comment-27641</guid>
		<description>[...] about UTF-8 Encoding. Then he gave a C++ code example of convert from/to UTF-16 to UTF-8. This is another example of writing UTF-8 in [...]</description>
		<content:encoded><![CDATA[<p>[...] about UTF-8 Encoding. Then he gave a C++ code example of convert from/to UTF-16 to UTF-8. This is another example of writing UTF-8 in [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sorin</title>
		<link>http://mariusbancila.ro/blog/2008/10/20/writing-utf-8-files-in-c/comment-page-1/#comment-27182</link>
		<dc:creator>Sorin</dc:creator>
		<pubDate>Sat, 09 May 2009 21:34:00 +0000</pubDate>
		<guid isPermaLink="false">http://mariusbancila.ro/blog/?p=135#comment-27182</guid>
		<description>I used this in order to create UTF-8 files:
_wfopen(strFile, L&quot;wt, ccs=UTF-8&quot;);

Nothing else needed. :D</description>
		<content:encoded><![CDATA[<p>I used this in order to create UTF-8 files:<br />
_wfopen(strFile, L&#8221;wt, ccs=UTF-8&#8243;);</p>
<p>Nothing else needed. <img src='http://mariusbancila.ro/blog/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: David Coorey</title>
		<link>http://mariusbancila.ro/blog/2008/10/20/writing-utf-8-files-in-c/comment-page-1/#comment-25115</link>
		<dc:creator>David Coorey</dc:creator>
		<pubDate>Tue, 17 Mar 2009 23:30:54 +0000</pubDate>
		<guid isPermaLink="false">http://mariusbancila.ro/blog/?p=135#comment-25115</guid>
		<description>Thanks for this article, Marius.  It was exactly what I needed to know.

I sometimes wonder how I managed to do my job before the internet was around...</description>
		<content:encoded><![CDATA[<p>Thanks for this article, Marius.  It was exactly what I needed to know.</p>
<p>I sometimes wonder how I managed to do my job before the internet was around&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: u0m3</title>
		<link>http://mariusbancila.ro/blog/2008/10/20/writing-utf-8-files-in-c/comment-page-1/#comment-25010</link>
		<dc:creator>u0m3</dc:creator>
		<pubDate>Sun, 15 Mar 2009 22:40:05 +0000</pubDate>
		<guid isPermaLink="false">http://mariusbancila.ro/blog/?p=135#comment-25010</guid>
		<description>locale(&quot;en_US.utf8&quot;); doesn&#039;t work in Visual Studio. For &quot;English_United States.1252&quot; you must use locale(&quot;English&quot;) but this does not set it to UTF-8.

This method seems to work only on linux.

Mr. Marius&#039;s example is the only working method for converting wchar_t to char UTF-8 on Windows/Visual Studio.

Ad as far as the encoding goes... Notepad seems to detect automatically the required encoding to display UTF-8 as far as I tested.</description>
		<content:encoded><![CDATA[<p>locale(&#8220;en_US.utf8&#8243;); doesn&#8217;t work in Visual Studio. For &#8220;English_United States.1252&#8243; you must use locale(&#8220;English&#8221;) but this does not set it to UTF-8.</p>
<p>This method seems to work only on linux.</p>
<p>Mr. Marius&#8217;s example is the only working method for converting wchar_t to char UTF-8 on Windows/Visual Studio.</p>
<p>Ad as far as the encoding goes&#8230; Notepad seems to detect automatically the required encoding to display UTF-8 as far as I tested.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Torkel Bj?¸rnson</title>
		<link>http://mariusbancila.ro/blog/2008/10/20/writing-utf-8-files-in-c/comment-page-1/#comment-24323</link>
		<dc:creator>Torkel Bj?¸rnson</dc:creator>
		<pubDate>Tue, 24 Feb 2009 23:54:58 +0000</pubDate>
		<guid isPermaLink="false">http://mariusbancila.ro/blog/?p=135#comment-24323</guid>
		<description>You can also do this:

wofstream file(&quot;test&quot;);
file.imbue(locale(&quot;en_US.utf8&quot;)); // can throw
file &lt;&lt; L&quot;this is a na??ve example&quot; &lt;&lt; endl;

Or if you know your default locale is UTF-8
file.imbue(locale(&quot;&quot;));</description>
		<content:encoded><![CDATA[<p>You can also do this:</p>
<p>wofstream file(&#8220;test&#8221;);<br />
file.imbue(locale(&#8220;en_US.utf8&#8243;)); // can throw<br />
file &lt;&lt; L&#8221;this is a na??ve example&#8221; &lt;&lt; endl;</p>
<p>Or if you know your default locale is UTF-8<br />
file.imbue(locale(&#8220;&#8221;));</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: mariusbancila</title>
		<link>http://mariusbancila.ro/blog/2008/10/20/writing-utf-8-files-in-c/comment-page-1/#comment-24046</link>
		<dc:creator>mariusbancila</dc:creator>
		<pubDate>Tue, 17 Feb 2009 20:02:52 +0000</pubDate>
		<guid isPermaLink="false">http://mariusbancila.ro/blog/?p=135#comment-24046</guid>
		<description>If it&#039;s already UTF_8 then write it just like you&#039;d write any other string. Use ofstream. You can see the last example in my post. Or maybe I&#039;m missing something and didn&#039;t understand you well.</description>
		<content:encoded><![CDATA[<p>If it&#8217;s already UTF_8 then write it just like you&#8217;d write any other string. Use ofstream. You can see the last example in my post. Or maybe I&#8217;m missing something and didn&#8217;t understand you well.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Nek</title>
		<link>http://mariusbancila.ro/blog/2008/10/20/writing-utf-8-files-in-c/comment-page-1/#comment-24032</link>
		<dc:creator>Nek</dc:creator>
		<pubDate>Tue, 17 Feb 2009 14:04:41 +0000</pubDate>
		<guid isPermaLink="false">http://mariusbancila.ro/blog/?p=135#comment-24032</guid>
		<description>If i have a string(WideChar) that contains UTF-8 character and I want to write it on a file, How do I do that?</description>
		<content:encoded><![CDATA[<p>If i have a string(WideChar) that contains UTF-8 character and I want to write it on a file, How do I do that?</p>
]]></content:encoded>
	</item>
</channel>
</rss>
