1 | initial version |
Since you cited PEP-263, read carefully the regular expression it gives for what the coding line should match:
^[ \t\f]*#.*?coding[:=][ \t]*([-_.a-zA-Z0-9]+)
specifically, the string coding
should be immediately followed by a :
or =
, no whitespace. The encoding name UTF-8
is fine since encoding names are not case-sensitive.
The most common way to write this is:
```
2 | No.2 Revision |
Since you cited PEP-263, read carefully the regular expression it gives for what the coding line should match:
^[ \t\f]*#.*?coding[:=][ \t]*([-_.a-zA-Z0-9]+)
specifically, the string coding
should be immediately followed by a :
or =
, no whitespace. The encoding name UTF-8
is fine since encoding names are not case-sensitive.
The most common way to write this is:
```
```
3 | No.3 Revision |
Since you cited PEP-263, read carefully the regular expression it gives for what the coding line should match:
^[ \t\f]*#.*?coding[:=][ \t]*([-_.a-zA-Z0-9]+)
specifically, the string coding
should be immediately followed by a :
or =
, no whitespace. The encoding name UTF-8
is fine since encoding names are not case-sensitive.
The most common way to write this is:
```
```
4 | No.4 Revision |
Since you cited PEP-263, read carefully the regular expression it gives for what the coding line should match:
^[ \t\f]*#.*?coding[:=][ \t]*([-_.a-zA-Z0-9]+)
specifically, the string coding
should be immediately followed by a :
or =
, no whitespace. The encoding name UTF-8
is fine since encoding names are not case-sensitive.
The most common way to write this is:
```
# -*-
coding: utf-8 ```
5 | No.5 Revision |
Since you cited PEP-263, read carefully the regular expression it gives for what the coding line should match:
^[ \t\f]*#.*?coding[:=][ \t]*([-_.a-zA-Z0-9]+)
specifically, the string coding
should be immediately followed by a :
or =
, no whitespace. The encoding name UTF-8
is fine since encoding names are not case-sensitive.
The most common way to write this is:
# -*- coding: utf-8 -*-
Note: Since this is just a standard Python feature it is not specific to Sage, so you could also likely find answers to your problem on StackOverflow or any other source for Python help.