Return original text that fails to decode
This commit is contained in:
parent
d66794c305
commit
a4ccaae4ae
1 changed files with 5 additions and 8 deletions
|
@ -10,19 +10,16 @@ from nntp.tiny.db import DatabaseTable
|
|||
def decode(text: str):
|
||||
decoded = decode_header(text)[0]
|
||||
|
||||
if decoded[1] is None:
|
||||
if decoded[0] == b'':
|
||||
return ''
|
||||
if decoded[0] == b'':
|
||||
return ''
|
||||
|
||||
return str(decoded[0])
|
||||
if decoded[1] is None:
|
||||
return text
|
||||
|
||||
try:
|
||||
return str(decoded[0], decoded[1])
|
||||
except:
|
||||
if decoded[0] == b'':
|
||||
return ''
|
||||
|
||||
return str(decoded[0])
|
||||
return text
|
||||
|
||||
def each_line(text: str):
|
||||
start = 0
|
||||
|
|
Loading…
Add table
Reference in a new issue