RAGFlow is an agent-native database: a Retrieval-Augmented Generation (RAG) engine that grew into context infrastructure.
Go agent-harnessagent-native-databaseagentic-aiagentic-retrievalagentic-searchaiai-agentscontext-enginecontext-engineeringcontext-managementharness-engineeringknowledge-compilationragretrieval-augmented-generationretrieval-harnesssearch-harness
fix file encoding detection bug (#653)
KevinHuShc6b6c748aead
diff --git a/api/apps/file_app.py b/api/apps/file_app.pyindex 93fd3fdb38..b94c15506f 100644--- a/api/apps/file_app.py+++ b/api/apps/file_app.py@@ -335,7 +335,7 @@ def get(file_id):response = flask.make_response(MINIO.get(file.parent_id, file.location))ext = re.search(r"\.([^.]+)$", file.name)if ext:- if doc.type == FileType.VISUAL.value:+ if file.type == FileType.VISUAL.value:response.headers.set('Content-Type', 'image/%s' % ext.group(1))else:response.headers.set(diff --git a/rag/nlp/__init__.py b/rag/nlp/__init__.pyindex 61ba8401bb..3a921c2ca6 100644--- a/rag/nlp/__init__.py+++ b/rag/nlp/__init__.py@@ -28,11 +28,17 @@ all_codecs = [def find_codec(blob):global all_codecsfor c in all_codecs:+ try:+ blob[:1024].decode(c)+ return c+ except Exception as e:+ passtry:blob.decode(c)return cexcept Exception as e:pass+return "utf-8"