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
5a2a2825
Commit
5a2a2825
authored
May 13, 2004
by
Barry Warsaw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
encode_7or8bit(): Clearing out some old patches; iso-2202 is non-ASCII but
still 7-bit.
parent
4f929360
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
5 deletions
+10
-5
Lib/email/Encoders.py
Lib/email/Encoders.py
+10
-5
No files found.
Lib/email/Encoders.py
View file @
5a2a2825
# Copyright (C) 2001
,2002
Python Software Foundation
# Copyright (C) 2001
-2004
Python Software Foundation
# Author: barry@
zope.com
(Barry Warsaw)
# Author: barry@
python.org
(Barry Warsaw)
"""Module containing encoding functions for Image.Image and Text.Text.
"""Encodings and related functions."""
"""
import
base64
import
base64
...
@@ -84,7 +83,13 @@ def encode_7or8bit(msg):
...
@@ -84,7 +83,13 @@ def encode_7or8bit(msg):
try
:
try
:
orig
.
encode
(
'ascii'
)
orig
.
encode
(
'ascii'
)
except
UnicodeError
:
except
UnicodeError
:
msg
[
'Content-Transfer-Encoding'
]
=
'8bit'
# iso-2022-* is non-ASCII but still 7-bit
charset
=
msg
.
get_charset
()
output_cset
=
charset
and
charset
.
output_charset
if
output_cset
and
output_cset
.
lower
().
startswith
(
'iso-2202-'
):
msg
[
'Content-Transfer-Encoding'
]
=
'7bit'
else
:
msg
[
'Content-Transfer-Encoding'
]
=
'8bit'
else
:
else
:
msg
[
'Content-Transfer-Encoding'
]
=
'7bit'
msg
[
'Content-Transfer-Encoding'
]
=
'7bit'
...
...
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