That depends on what the remote system is expecting from you. There are about 10 different ways to encode the euro sign depending on the charset on the remote side.
You will have to ask someone who understands the remote system to tell you which encoding it expects.
After that, you can use the Unicode symbol \u20AC
and the codecs
module to convert that into the charset which the remote side expects.
Note that you will want to use Unicode strings as will if you still use Python 2 (u'...'
).
[EDIT] It seems the remote side is Windows or uses the Windows charset cp1252
(see this question)
So this should work:
t=u'FF\u20acFF\u20ac\r\n'
e=t.encode('cp1252')
tn.write(e)
response = tn.read_all().decode('cp1252')
print(response)
Note that you have to encode anything you send and decode anything you receive.
Also note: On Windows, the line end is \r\n
. Most programs don't work correctly if you send the wrong line ending.