more utf-8 issues
This commit is contained in:
parent
d3c8cdb572
commit
a306370f0d
3 changed files with 4 additions and 4 deletions
|
@ -28,8 +28,8 @@ def info(path):
|
||||||
return data
|
return data
|
||||||
|
|
||||||
def extract_text(path):
|
def extract_text(path):
|
||||||
with open(path) as fd:
|
with open(path, 'rb') as fd:
|
||||||
data = fd.read()
|
data = fd.read().decode('utf-8', errors='replace')
|
||||||
return data
|
return data
|
||||||
|
|
||||||
def extract_isbn(text):
|
def extract_isbn(text):
|
||||||
|
|
|
@ -55,7 +55,7 @@ class NodeHandler(tornado.web.RequestHandler):
|
||||||
content = settings.release
|
content = settings.release
|
||||||
else:
|
else:
|
||||||
if valid(key, data, sig):
|
if valid(key, data, sig):
|
||||||
action, args = json.loads(data)
|
action, args = json.loads(data.decode('utf-8'))
|
||||||
logger.debug('NODE action %s %s (%s)', action, args, key)
|
logger.debug('NODE action %s %s (%s)', action, args, key)
|
||||||
if action == 'ping':
|
if action == 'ping':
|
||||||
content = {
|
content = {
|
||||||
|
|
|
@ -28,7 +28,7 @@ def render(infile, outfile):
|
||||||
|
|
||||||
for line in f:
|
for line in f:
|
||||||
|
|
||||||
for line_ in line.decode('utf-8').strip().split('\r'):
|
for line_ in line.strip().split('\r'):
|
||||||
|
|
||||||
lines = wrapText(
|
lines = wrapText(
|
||||||
line_,
|
line_,
|
||||||
|
|
Loading…
Reference in a new issue