mirror of
https://github.com/PaddlePaddle/PaddleOCR.git
synced 2025-11-10 14:53:55 +00:00
fix win encode error
This commit is contained in:
parent
d9351d9a98
commit
eb9e3558c1
@ -346,14 +346,14 @@ class TableLabelDecode(object):
|
|||||||
list_elem = []
|
list_elem = []
|
||||||
with open(character_dict_path, "rb") as fin:
|
with open(character_dict_path, "rb") as fin:
|
||||||
lines = fin.readlines()
|
lines = fin.readlines()
|
||||||
substr = lines[0].decode('utf-8').strip("\n").split("\t")
|
substr = lines[0].decode('utf-8').strip("\n").strip("\r\n").split("\t")
|
||||||
character_num = int(substr[0])
|
character_num = int(substr[0])
|
||||||
elem_num = int(substr[1])
|
elem_num = int(substr[1])
|
||||||
for cno in range(1, 1 + character_num):
|
for cno in range(1, 1 + character_num):
|
||||||
character = lines[cno].decode('utf-8').strip("\n")
|
character = lines[cno].decode('utf-8').strip("\n").strip("\r\n")
|
||||||
list_character.append(character)
|
list_character.append(character)
|
||||||
for eno in range(1 + character_num, 1 + character_num + elem_num):
|
for eno in range(1 + character_num, 1 + character_num + elem_num):
|
||||||
elem = lines[eno].decode('utf-8').strip("\n")
|
elem = lines[eno].decode('utf-8').strip("\n").strip("\r\n")
|
||||||
list_elem.append(elem)
|
list_elem.append(elem)
|
||||||
return list_character, list_elem
|
return list_character, list_elem
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user