From a5fb59b17f53e582780371dd95a2704aa7126c03 Mon Sep 17 00:00:00 2001 From: zhu-an <70234959+xhdd123321@users.noreply.github.com> Date: Fri, 3 Jan 2025 19:12:48 +0800 Subject: [PATCH] fix: Encode Chinese characters with Unicode before querying to match the Unicode encoded Chinese characters in the db (#12337) Co-authored-by: zhaoqingyu.1075 --- api/services/workflow_app_service.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/services/workflow_app_service.py b/api/services/workflow_app_service.py index f89487415d..7eab0ac1d8 100644 --- a/api/services/workflow_app_service.py +++ b/api/services/workflow_app_service.py @@ -27,7 +27,7 @@ class WorkflowAppService: query = query.join(WorkflowRun, WorkflowRun.id == WorkflowAppLog.workflow_run_id) if keyword: - keyword_like_val = f"%{args['keyword'][:30]}%" + keyword_like_val = f"%{keyword[:30].encode('unicode_escape').decode('utf-8')}%".replace(r"\u", r"\\u") keyword_conditions = [ WorkflowRun.inputs.ilike(keyword_like_val), WorkflowRun.outputs.ilike(keyword_like_val),