Index: interpreter.rst =================================================================== --- interpreter.rst (revision 58273) +++ interpreter.rst (working copy) @@ -102,8 +102,9 @@ before printing the first prompt:: python - Python 1.5.2b2 (#1, Feb 28 1999, 00:02:06) [GCC 2.8.1] on sunos5 - Copyright 1991-1995 Stichting Mathematisch Centrum, Amsterdam + Python 3.0a1 (py3k, Sep 12 2007, 12:21:02) + [GCC 3.4.6 20060404 (Red Hat 3.4.6-8)] on linux2 + Type "help", "copyright", "credits" or "license" for more information. >>> Continuation lines are needed when entering a multi-line construct. As an @@ -172,7 +173,8 @@ .. XXX out of date! -It is possible to use encodings different than ASCII in Python source files. The +By default, Python source files are encoded as UTF-8, though it is possible to +specify a different encoding. The best way to do it is to put one more special comment line right after the ``#!`` line to define the source file encoding:: @@ -192,20 +194,14 @@ # -*- coding: iso-8859-15 -*- - currency = u"€" + currency = "€" print(ord(currency)) -If your editor supports saving files as ``UTF-8`` with a UTF-8 *byte order mark* -(aka BOM), you can use that instead of an encoding declaration. IDLE supports -this capability if ``Options/General/Default Source Encoding/UTF-8`` is set. -Notice that this signature is not understood in older Python releases (2.2 and -earlier), and also not understood by the operating system for script files with -``#!`` lines (only used on Unix systems). - -By using UTF-8 (either through the signature or an encoding declaration), +By using UTF-8, characters of most languages in the world can be used simultaneously in string -literals and comments. Using non-ASCII characters in identifiers is not -supported. To display all these characters properly, your editor must recognize +literals and comments. Using non-ASCII characters in identifiers is supported +(although the standard library only uses ASCII). +To display all these characters properly, your editor must recognize that the file is UTF-8, and it must use a font that supports all the characters in the file.