bob gailer wrote: > my python file starts with # -*- coding: utf-8 -*- > > There is a unicode character 2501 in the file > > I am editing with python for windows 3.7 build 224 > > Saving the file results in an error: 'latin-1' codec can't encode character > \u2501 > > What am I doing wrong? > > -- > Bob Gailer
Just guessing but maybe the problem is that it's not a UTF8 file and Python is falling back to latin1 (because it knows it isn't ASCII). You say there is a unicode character in it (\u2501). But that character, encoded in UTF-8 is 0xE2 0x94 0x81. Try changing the charset declaration to match the actual unicode encoding that it is using. Not sure what it is but possibly UTF-16. cheers, raf _______________________________________________ python-win32 mailing list python-win32@python.org https://mail.python.org/mailman/listinfo/python-win32