Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   C++ (http://www.velocityreviews.com/forums/f39-c.html)
-   -   read data from a text file (http://www.velocityreviews.com/forums/t744198-read-data-from-a-text-file.html)

gopesh patel 02-25-2011 10:09 PM

read data from a text file
 
Hello all,

I have a text file and I want to read the data from it. I know I can
do it by using getline or fread kind of functions.

But the problem is data looks encoded in some unknown format and
whenever I try to use getline or fread it doesn't show me anything.

The data is in a text file called test.txt and it looks like
following :

A Î4?ÏÑ>¡¿*ôR>è¢ ¾Ò®û¾òô>~<è ¾uEð>uÕ¾Çû>A>ó´>…þ>ûˆ¾îJ
?

Can someone help me with reading it ?

Thanks,
Gopesh

James Kanze 02-26-2011 12:18 PM

Re: read data from a text file
 
On Feb 25, 10:09 pm, gopesh patel <patelgop...@gmail.com> wrote:

> I have a text file and I want to read the data from it. I know I can
> do it by using getline or fread kind of functions.


> But the problem is data looks encoded in some unknown format and
> whenever I try to use getline or fread it doesn't show me anything.


> The data is in a text file called test.txt and it looks like
> following :


> A Î 4?ÏÑ >¡ ¿*ôR>è¢ ¾Ò®û¾òô >~<è¾uEð> uÕ¾ Çû> A> ó´>… þ> ûˆ¾îJ
> ?


> Can someone help me with reading it ?


It looks like some other encoding. (Since news, at least when
read through Google, tends to mangle encodings somewhat, I won't
venture a guess as to what it was originally.) Find out what
encoding was used, imbue the appropriate locale, and you should
be able to read it (although you might have to use wide
characters).

--
James Kanze


All times are GMT. The time now is 11:17 PM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.