Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
d6d6a78a
Commit
d6d6a78a
authored
Jun 29, 2003
by
Skip Montanaro
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
minor wordsmithing
parent
f8194214
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
+6
-6
Doc/tut/tut.tex
Doc/tut/tut.tex
+6
-6
No files found.
Doc/tut/tut.tex
View file @
d6d6a78a
...
...
@@ -307,28 +307,28 @@ comment in Python.
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
\code
{
\#
!
}
line making proper encoding declaration
:
right after
the
\code
{
\#
!
}
line to define the source file encoding
:
\begin{verbatim}
# -*- coding: iso-8859-1 -*-
\end{verbatim}
With that declaration, all characters in the source file will be
treated as belonging to
\code
{
iso-8859-1
}
encoding
, and it will be
With that declaration, all characters in the source file will be
treated as
{}
\code
{
iso-8859-1
}
, and it will be
possible to directly write Unicode string literals in the selected
encoding. The list of possible encodings can be found in the
encoding.
The list of possible encodings can be found in the
\citetitle
[../lib/lib.html]
{
Python Library Reference
}
, in the section
on
\module
{
codecs
}
.
If your editor supports saving files as
\code
{
UTF-8
}
with an UTF-8
signature (aka BOM -- Byte Order Mark), you can use that instead of an
encoding declaration. IDLE supports
such saving
if
encoding declaration. IDLE supports
this capability
if
\code
{
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
\code
{
\#
!
}
files.
By using UTF-8 (either through the signature
, or a
an encoding
By using UTF-8 (either through the signature
or
an encoding
declaration), 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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment