Skip to content

armgit / dify

Public Imported from GitHub
0

Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack.

ascii filter Unicode U+FFFE (#2038)

Jyongcb7a608d75ac
diff --git a/api/core/indexing_runner.py b/api/core/indexing_runner.py
index 28a99d2f7f4..22a60ae5674 100644
--- a/api/core/indexing_runner.py
+++ b/api/core/indexing_runner.py
@@ -531,7 +531,9 @@ class IndexingRunner:
def filter_string(self, text):
text = re.sub(r'<\|', '<', text)
text = re.sub(r'\|>', '>', text)
- text = re.sub(r'[\x00-\x08\x0B\x0C\x0E-\x1F\x7F\x80-\xFF]', '', text)
+ text = re.sub(r'[\x00-\x08\x0B\x0C\x0E-\x1F\x7F\xEF\xBF\xBE]', '', text)
+ # Unicode U+FFFE
+ text = re.sub(u'\uFFFE', '', text)
return text
def _get_splitter(self, processing_rule: DatasetProcessRule,