[wingide-users] File Encoding
Wingware Support
support at wingware.com
Tue Oct 4 13:28:53 EDT 2005
On Tue, 4 Oct 2005, Ken Kinder wrote:
> I noticed WingIDE lets you set the encoding type of files, so I was
> hoping it would actually insert (and even better, observe) the encoding
> hints Python uses. See:
>
> http://www.python.org/peps/pep-0263.html
We do detect and use coding comments when present. While a file is
open it's internally encoded as utf-8 unicode and we store it to disk
using the encoding set in the coding comment, or via file attribute,
or guessing based on file system or default encoding for the system
(in that order).
Using the coding comment is *highly* recommended because otherwise
there's (usually) no data with the file itself that would tell another
editor what encoding it is in. When a coding comment is present, Wing
disables the File Properties option for changing encoding.
We don't auto-write encoding comments because that could be annoying
w/ revision control systems and we felt it was too "magic" to do that
when people use the File Properties to set an encoding. The Encoding
file property is there mainly so people can read files that don't
specify an encoding, especially on machines that have file system or
default encoding that don't match the file. This is done by
right-clicking on the file name in the Project view. Yes, this is a
bit obscure -- we eventually will add an encoding selector in the
file open dialog as well.
If for some reason this isn't working for you, please let us know.
For example, if you place a coding comment and save, then the File
Properties dialog should list Encoding as "set by encoding comment"
with the right encoding shown.
Stephan Deibel
--
Wingware
Wing IDE for Python
Advancing Software Development
www.wingware.com
More information about the wingide-users
mailing list