This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Tutorial: info on Source Code Encoding is missing
Type: Stage:
Components: Documentation Versions: Python 2.3
process
Status: closed Resolution: accepted
Dependencies: Superseder:
Assigned To: loewis Nosy List: loewis, rhettinger, rnd0110
Priority: normal Keywords:

Created on 2003-02-09 17:50 by rnd0110, last changed 2022-04-10 16:06 by admin. This issue is now closed.

Messages (3)
msg14537 - (view) Author: Roman Suzi (rnd0110) Date: 2003-02-09 17:50
(I propose to add information into Tutorial on how
to specify source code encoding. Please correct
my English and maybe there is better way to 
get a list of possible encodings)



2.2.2  Executable Python Scripts 

...

2.2.3 Source Code Encoding

   It is possible to use encodings different than ASCII
in Python
   source files. The best way to do it is to put one more
   special comment line right after #!-line making
proper encoding
   declaration:
  
# -*- coding: latin-1 -*-

   After that, all characters in the source file will
be treated
   as belonging to latin-1 encoding, and it will be
possible
   to directly write Unicode strings in the selected
encoding.

   List of possible encodings could be found in the
encodings
   subdirectory of Python directory.

   Significant advantage could be had if using utf-8
encoding,
   as it allows to use letters from many languages in
the same
   file.

2.2.4
msg14538 - (view) Author: Raymond Hettinger (rhettinger) * (Python committer) Date: 2003-06-25 18:43
Logged In: YES 
user_id=80475

Martin, I think something like the above wording should be 
added to the tutorial.  Do you have any wording suggestions?

* Instead of latin-1, it should list the ISO number.
* The encodings directory is a subdirectory of Lib.
* The last paragraph should be replaced and instead make 
your recommendation to arrange IDLE so that it
always stores files as UTF-8 with BOM.
msg14539 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2003-06-28 08:12
Logged In: YES 
user_id=21627

I have added text in tut.tex 1.188 which was heavily
inspired by Roman's text; thanks for contributing.
History
Date User Action Args
2022-04-10 16:06:40adminsetgithub: 37947
2003-02-09 17:50:28rnd0110create