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
ee07cb1d
Commit
ee07cb1d
authored
Oct 10, 2002
by
Barry Warsaw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
get_content_charset(): RFC 2046 $4.1.2 says charsets are not case
sensitive. Coerce the argument to lower case.
parent
14fc464e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
4 deletions
+6
-4
Lib/email/Message.py
Lib/email/Message.py
+6
-4
No files found.
Lib/email/Message.py
View file @
ee07cb1d
...
...
@@ -760,8 +760,9 @@ class Message:
def
get_content_charset
(
self
,
failobj
=
None
):
"""Return the charset parameter of the Content-Type header.
If there is no Content-Type header, or if that header has no charset
parameter, failobj is returned.
The returned string is always coerced to lower case. If there is no
Content-Type header, or if that header has no charset parameter,
failobj is returned.
"""
missing
=
[]
charset
=
self
.
get_param
(
'charset'
,
missing
)
...
...
@@ -769,8 +770,9 @@ class Message:
return
failobj
if
isinstance
(
charset
,
TupleType
):
# RFC 2231 encoded, so decode it, and it better end up as ascii.
return
unicode
(
charset
[
2
],
charset
[
0
]).
encode
(
'us-ascii'
)
return
charset
charset
=
unicode
(
charset
[
2
],
charset
[
0
]).
encode
(
'us-ascii'
)
# RFC 2046, $4.1.2 says charsets are not case sensitive
return
charset
.
lower
()
def
get_charsets
(
self
,
failobj
=
None
):
"""Return a list containing the charset(s) used in this message.
...
...
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