solution gateway medium macos

Browser tool: URLs with Chinese characters are mis-encoded

Work around a browser tool encoding bug by pre-encoding non-ASCII query parameters (UTF-8) before calling the browser tool.

By CoClaw Team

Symptoms

  • Using the browser tool with a targetUrl that includes Chinese characters in query parameters navigates to the wrong page/query.
  • The final URL shows percent-encoding that maps to different characters than what you intended.

Cause

The browser tool incorrectly encodes non-ASCII characters in URL query parameters (not producing the expected UTF-8 percent-encoding).

Fix

Until OpenClaw fixes the upstream encoding bug, use one of these workarounds so the browser tool only receives ASCII URLs.

Build the URL with proper UTF-8 encoding (and avoid double-encoding).

JavaScript / TypeScript:

const q = "AI革命";
const url = "https://www.google.com/search?q=" + encodeURIComponent(q);
// Pass `url` to the browser tool.

Python:

import urllib.parse

q = "AI革命"
url = "https://www.google.com/search?q=" + urllib.parse.quote(q, safe="")

2) If you already have a correct percent-encoded URL, do not re-encode it

If your URL already contains %E9%9D%A9... style sequences, pass it through as-is.

Verify

  • The browser navigates to the intended query/page.
  • The URL uses the expected UTF-8 percent-encoding for the Chinese characters (for example, "AI革命" encodes to %E9%9D%A9%E5%91%BD).
  • GitHub: #9574

Verification & references

  • Reviewed by:CoClaw Code Team
  • Last reviewed:March 14, 2026
  • Verified on: macOS

References

Want to explore more? Browse all solutions or ask in the Community Forum .
Report a problem

Related Resources

Browser tool: 'browser control service timeout'
Fix
Fix browser automation timeouts by confirming the gateway/browser service is alive, reducing the repro, and addressing container/headless dependency and memory issues.
Custom OpenAI-compatible endpoint rejects tools or tool_choice
Fix
Fix custom or proxy AI endpoints that can chat normally but fail once OpenClaw sends tools, tool_choice, parallel_tool_calls, or later tool-result turns.
Local llama.cpp, Ollama, and vLLM tool-calling compatibility
Fix
Understand why local-model servers can chat normally but still fail on agent tool calling, tool-result continuation, or OpenAI-compatible multi-turn behavior in OpenClaw.
Model outputs '[Historical context]' / tool-call JSON instead of a normal reply
Fix
Fix chat replies that leak internal tool metadata (e.g. '[Historical context: ... Do not mimic ...]') by switching to a tool-capable model/provider and ensuring function calling is enabled.
OpenClaw Remote Browser Setup: Gateway on One Machine, Browser on Another
Guide
Choose a stable remote-browser topology for OpenClaw, pin the right browser-capable node, and verify that gateway routing, relay startup, and browser takeover all land on the machine you intended.
OpenClaw Browser Automation Timeouts: Fix 'browser control service timeout'
Guide
Stabilize OpenClaw browser runs (Playwright) when they time out: verify the browser service is alive, increase timeouts where appropriate, reduce page complexity, and fix common headless/container dependencies.