I'm trying a simple program to send some html down a socket to a client. 2 things are goofing me up.
The code:
c.send( str.encode("<HTML><BODY>Test Page<///BODY><///HTML>") )
My python client receives:
b'<HTML><BODY>Test Page<///BODY><///HTML>'
According to Beginning Python which says it covers Python 3 (I'm using 3.1.1 on Windows), there is a String.Decode function. My environment cannot find it. I assume I'll run into the errors ('strict', 'ignore', 'replace' ) next.
Obviously, the extra /// is just guessing.
1) How do I decode this in Python?
2) I use my browser and obviously the HTML code is wrong, but I can see the server sent it. How do I make the HTML browser friendly?
Cordially,
Stephen