### What problem does this PR solve? #651 ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue)tags/v0.5.0
| @@ -69,7 +69,7 @@ class RAGFlowExcelParser: | |||
| if fnm.split(".")[-1].lower() in ["csv", "txt"]: | |||
| encoding = find_codec(binary) | |||
| txt = binary.decode(encoding) | |||
| txt = binary.decode(encoding, errors="ignore") | |||
| return len(txt.split("\n")) | |||
| @@ -91,7 +91,7 @@ def chunk(filename, binary=None, from_page=0, to_page=100000, | |||
| txt = "" | |||
| if binary: | |||
| encoding = find_codec(binary) | |||
| txt = binary.decode(encoding) | |||
| txt = binary.decode(encoding, errors="ignore") | |||
| else: | |||
| with open(filename, "r") as f: | |||
| while True: | |||
| @@ -113,7 +113,7 @@ def chunk(filename, binary=None, from_page=0, to_page=100000, | |||
| txt = "" | |||
| if binary: | |||
| encoding = find_codec(binary) | |||
| txt = binary.decode(encoding) | |||
| txt = binary.decode(encoding, errors="ignore") | |||
| else: | |||
| with open(filename, "r") as f: | |||
| while True: | |||
| @@ -141,7 +141,7 @@ def chunk(filename, binary=None, from_page=0, to_page=100000, | |||
| txt = "" | |||
| if binary: | |||
| encoding = find_codec(binary) | |||
| txt = binary.decode(encoding) | |||
| txt = binary.decode(encoding, errors="ignore") | |||
| else: | |||
| with open(filename, "r") as f: | |||
| while True: | |||
| @@ -85,7 +85,7 @@ def chunk(filename, binary=None, from_page=0, to_page=100000, | |||
| txt = "" | |||
| if binary: | |||
| encoding = find_codec(binary) | |||
| txt = binary.decode(encoding) | |||
| txt = binary.decode(encoding, errors="ignore") | |||
| else: | |||
| with open(filename, "r") as f: | |||
| while True: | |||
| @@ -107,7 +107,7 @@ def chunk(filename, binary=None, lang="Chinese", callback=None, **kwargs): | |||
| txt = "" | |||
| if binary: | |||
| encoding = find_codec(binary) | |||
| txt = binary.decode(encoding) | |||
| txt = binary.decode(encoding, errors="ignore") | |||
| else: | |||
| with open(filename, "r") as f: | |||
| while True: | |||
| @@ -149,7 +149,7 @@ def chunk(filename, binary=None, from_page=0, to_page=10000000000, | |||
| txt = "" | |||
| if binary: | |||
| encoding = find_codec(binary) | |||
| txt = binary.decode(encoding) | |||
| txt = binary.decode(encoding, errors="ignore") | |||
| else: | |||
| with open(filename, "r") as f: | |||
| while True: | |||