Skip to content

Commit

Permalink
Merge pull request #1 from gitzjm/gitzjm-patch-2
Browse files Browse the repository at this point in the history
Update utils.py
  • Loading branch information
gitzjm authored Oct 5, 2018
2 parents f923840 + d46e5fa commit 69866e1
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions PyPDF2/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,10 +235,17 @@ def b_(s):
if type(s) == bytes:
return s
else:
r = s.encode('latin-1')
if len(s) < 2:
bc[s] = r
return r
try:
r = s.encode('latin-1')
if len(s) < 2:
bc[s] = r
return r
except Exception as e:
print(s)
r = s.encode('utf-8')
if len(s) < 2:
bc[s] = r
return r


def u_(s):
Expand Down

0 comments on commit 69866e1

Please sign in to comment.