read data from a text file

G

gopesh patel

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
 
J

James Kanze

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).
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,989
Messages
2,570,207
Members
46,783
Latest member
RickeyDort

Latest Threads

Top