Re: space

[ISOpub entities]

   None of those are usable for computer source code, however. In source
   code, a specific number of space characters can be vital to the correct
   functioning of the program! Currently, HTML is unusable as a means of
   transmitting source code; other content types must be used instead.

<pre> will replicate its content untouched in all browsers I know.
But yes, it's the wrong tool to use for sending source code. Zipped
or tarred/gzipped files are a much better idea.