On Thu, 10 Mar 2016 02:06 am, Jon Ribbens wrote: > On 2016-03-09, Steven D'Aprano <st...@pearwood.info> wrote: >> generate the output. Without seeing the code you used, I have *no idea* >> how you could get that result. If you read the file in binary, you should >> get this: >> >> b'\xef\xbb\xbf\xe2\x82\xac\xe2\x82\xac\xe2\x82\xac' >> >> Or in decimal: >> >> 239, 187, 191, 226, 130, 172, 226, 130, 172, 226, 130, 172 >> >> How you are getting 8218 instead of 130, I have no idea! > > Decode as "windows-1252".
Nicely done! py> b'\xef\xbb\xbf\xe2\x82\xac\xe2\x82\xac\xe2\x82\xac'.decode('cp1252') '€€€' py> [ord(c) for c in _] [239, 187, 191, 226, 8218, 172, 226, 8218, 172, 226, 8218, 172] -- Steven -- https://mail.python.org/mailman/listinfo/python-list