<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Reflections of a scattered Mind !! &#187; files</title>
	<atom:link href="http://blog.saionline.co.in/tag/files/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.saionline.co.in</link>
	<description>&#34;Not all scattered pieces are of broken glass&#34;</description>
	<lastBuildDate>Mon, 14 Nov 2011 20:56:24 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
<cloud domain='blog.saionline.co.in' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
		<item>
		<title>I had a problem</title>
		<link>http://blog.saionline.co.in/2009/12/i-had-a-problem/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=i-had-a-problem</link>
		<comments>http://blog.saionline.co.in/2009/12/i-had-a-problem/#comments</comments>
		<pubDate>Mon, 30 Nov 2009 23:52:29 +0000</pubDate>
		<dc:creator>Sai Prasad</dc:creator>
				<category><![CDATA[Technical]]></category>
		<category><![CDATA[c++]]></category>
		<category><![CDATA[files]]></category>

		<guid isPermaLink="false">http://blog.saionline.co.in/?p=182</guid>
		<description><![CDATA[Symptoms: 

Language: C++, Operating System: Windows
Target Audience: Programmers
Sub Area: Reading ASCII / UTF-8 files from the disk using C++ streams.
Trouble: How to handle files whose file names contains non-ASCII characters?? (coz ifstream takes a ASCII file path   )

Solution:

Use  [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Symptoms: </strong></p>
<ul>
<li>Language: C++, Operating System: Windows</li>
<li>Target Audience: Programmers</li>
<li>Sub Area: Reading ASCII / UTF-8 files from the disk using C++ streams.</li>
<li>Trouble: How to handle files whose file names contains non-ASCII characters?? (coz ifstream takes a ASCII file path <img src='http://blog.saionline.co.in/wp-includes/images/smilies/icon_sad.gif' alt=':-(' class='wp-smiley' />  )</li>
</ul>
<p><strong>Solution:</strong></p>
<ul>
<li>Use _wfopen_s(), the safe version of _wfopen(), which takes a wide-character file name &amp; gives a FILE pointer i.e; FILE*.</li>
<li>Use the obtained FILE* to create a stream, like ifstream in(fp);</li>
<li>We used wide-character file name &amp; are reading the file byte-by-byte (actually, its char). DONE !! <img src='http://blog.saionline.co.in/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </li>
</ul>
<p>BTW, I got help from <a href="http://bytes.com/topic/net/answers/264598-iostream-question-how-open-unicode-file-name">here</a> ! Hope this saves  time for someone out there&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.saionline.co.in/2009/12/i-had-a-problem/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

