khoj-ai / khoj

Your AI second brain. Self-hostable. Get answers from the web or your docs. Build custom agents, schedule automations, do deep research. Turn any online or local LLM into your personal, autonomous AI (e.g gpt, claude, gemini, llama, qwen, mistral).
https://khoj.dev
GNU Affero General Public License v3.0
14.7k stars 730 forks source link

[FIX] Multibyte query support #935

Open adamist521 opened 1 month ago

adamist521 commented 1 month ago

Describe the bug

I get following error when I input multibyte character when querying.

error in process sentinel: Multibyte text in HTTP request: POST /api/chat?client=emacs HTTP/1.1
MIME-Version: 1.0
Connection: keep-alive
Host: 127.0.0.1:42110
Accept-encoding: gzip
Accept: */*
User-Agent: URL/Emacs Emacs/29.1 (Mac; aarch64-apple-darwin23.4.0)
Authorization: Bearer YOUR_KHOJ_CLOUD_API_KEY
Content-Type: application/json
Content-length: 23

{"q":"日本語いけますか?","n":8}

To Reproduce

Platform

If self-hosted

Additional context

Searching around, I've found some issues seems to relate to this bug so I'll list it below.