[wingide-users] WingIDE's help w/ PEP 0263
Wingware Support
support at wingware.com
Wed Feb 8 14:14:25 EST 2006
On Wed, 8 Feb 2006, Ken Kinder wrote:
> I happily noticed WingIDE observes PEP 0263 for encoding compliance:
> http://www.python.org/peps/pep-0263.html
>
> I was wondering if there's anyway it can help me find files that in my
> project that have 8-bit text (non-ascii) that don't have an encoding header?
> It would also be nice if when I have a non-ascii Python file, it would
> prompt me to add that header upon saving.
Wing doesn't have a feature like that now, although it's pretty
easy write a utility in Python to os.listdir (or similar) and
read the whole file to check if ord() of any char in it is >127.
One problem w/ actually adding encoding headers is that it's not
certain that a file's encoding is guessable from its content.
Also, keep in mind that UTF encodings sometimes place a byte
order mark at the start of the file which takes care of
specifying the encoding w/o placing an encoding header (just in
case you have such files).
Stephan Deibel
--
Wingware
Wing IDE for Python
Advancing Software Development
www.wingware.com
More information about the wingide-users
mailing list