mirror of
https://github.com/infiniflow/ragflow.git
synced 2025-12-08 20:42:30 +08:00
Always open text file for write with UTF-8 (#3688)
### What problem does this PR solve? Always open text file for write with UTF-8. Close #932 ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue)
This commit is contained in:
@ -41,7 +41,7 @@ def main(args):
|
||||
"score": 1} for b, t in bxs if b[0][0] <= b[1][0] and b[0][1] <= b[-1][1]]
|
||||
img = draw_box(images[i], bxs, ["ocr"], 1.)
|
||||
img.save(outputs[i], quality=95)
|
||||
with open(outputs[i] + ".txt", "w+") as f:
|
||||
with open(outputs[i] + ".txt", "w+", encoding='utf-8') as f:
|
||||
f.write("\n".join([o["text"] for o in bxs]))
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user