Notpad doesn't display it correctly. All non-standard characters are displayed like a box or some other weird symbol that says I don't understand this. Not to mention, Notepad may be a bit more complex than it seems.
Notpad doesn't display it correctly. All non-standard characters are displayed like a box or some other weird symbol that says I don't understand this. Not to mention, Notepad may be a bit more complex than it seems.
Sent from my iPadŽ
So is there a way just to ignore all non-standard characters?
lu lu lu I've got some apples lu lu lu You've got some too lu lu lu Let's make some applesauce Take off our clothes and lu lu lu
Not that I know of.
...that's not to say there is no way. Do some research on it.
Sent from my iPadŽ
use get instead and you will be able to get every character. The following will read every character and store it in buffer until EOF or 200 characters have been reached
Code:#include <fstream> using namespace std; void main() { char buffer[200]; int index = 0; ifstream fin; fin.open("blbalba.txt"); while(fin.get(buffer[index++])) if (index == 200) break; }
Last edited by Darryl; 12-01-2005 at 02:04 PM. Reason: spelling
Hmmm... even non-ascii characters?
Sent from my iPadŽ
Do you mean non-printing characters? (Tabs, line-feed, etc) If so, then yes with the exception of I think char(26) (ctrl-z) which gets interpreted as EOF and will stop the while loop. Displaying them is a different matter, but they will be read and stored. For example Carriage Return will be stored as 13Originally Posted by SlyMaelstrom
Or do you mean non-ascii as in Unicode or wide characters, if so it will read them as well, but at 2 chars per letter.
one other note, you may also be referring to extended ascii, using a signed char will cause them to be stored as negatives, while using unsigned char will allow them to be stored correctly (128 - 255). Again displaying them may be another matter depending on your environment.
Last edited by Darryl; 12-01-2005 at 02:19 PM.
Ok, I see what you're saying. Just to remove confusion, I was talking like this: Open a wav file in a text editor and save it as a text document. Try to open that and read it in, right towards the beginning where it defines bitrate and length of the wav file in seconds it gets stuck and stops reading it in. There is something there that it won't take.
Sent from my iPadŽ
It's probably hitting that char(26) I was talking about. The only way to read that is binary. I found that out in an encryption contest I had participated in. The host of the contest had used a substitution cypher using all ascii codes, but I couldn't read in his file cuz it kept hitting that. I verified it with a hex editor and he had to change his algorithm to exclue it.
Allright i Quit.
I managed to find a diffrent way to solve my problem.
The thing is that, the text file i was talking about was a database of somekind for my project.
Now i have found *.mdb with the same data, so i'm gonna try to load that...
lu lu lu I've got some apples lu lu lu You've got some too lu lu lu Let's make some applesauce Take off our clothes and lu lu lu
Most MTG programs allow card bodies with carriage returns. If I remember correctly it's (char)13. Load the library into whichever program you use and take a look at 1996 World Champ to see what I mean.
You have a few options:
1. Remove every carriage return symbol from your database and lose that functionality.
2. Load the database until EOF and assign entries as is appropriate (that's what the @'s and ;'s are there for.)
3. Replace each instance of carriage return with a non-invasive ASCII character (this is probably the simplest, and most do-able option) which you can then set to trigger a carriage return at a more convenient time.
4. Write your own database.
If you give up, you suck.
Last edited by Austaph; 12-01-2005 at 07:20 PM.
Now i have found *.mdb with the same data, so i'm gonna try to load that...
Why should i lose my sanity with this??? symbol of some kind???
lu lu lu I've got some apples lu lu lu You've got some too lu lu lu Let's make some applesauce Take off our clothes and lu lu lu
Anyway i'm making program for playing MTG online. Are you playing MTG?
lu lu lu I've got some apples lu lu lu You've got some too lu lu lu Let's make some applesauce Take off our clothes and lu lu lu