I'm trying to make a python program that converts text to one long binary string. The usual line of test and sentences are easy enough to convert into binary but I'm having trouble with the whitespace.
How do I put in a binary byte to represent the enter key?  
Do I just put in the '/' and an 'n' strings?  
I would ideally want to be able to convert an entire text file into a binary string and be able to convert it back again. Obviously, if I were to do this with a python script, the tabbing would get messed up and the program would be broken.  
Would a C language be better for doing this stuff?  
Obviously a C program would still function without its whitespace whereas python would not.
In short, I need to know how to represent the 'tab' and 'enter' keys in binary, and how to create a function to translate them into binary. would bin(ord('\n')) be good?
The tab is represented in the ASCII chart as 0x08 0x09, or "00001000" "00001001" in a binary string.  
The Enter key is different because it could represent CR (carriage return), LF (Linefeed), or both.  
The CR is represented as 0x0d, or "00001101" as binary string.
The LF is represented as 0x0A, or "00001010" as binary string.
A common convention is '\t' for tab and '\r' for CR, '\n' for newline.
text - binary conversion