Reuse charset-aware decoding for fetched pages

A contributor fixed OpenClaw’s page-decoding step so Shift_JIS pages no longer turned into replacement characters.

Done with OpenClaw· Intermediate· Oct 2026

What they did
They traced the problem to OpenClaw’s link-understanding step, which was treating fetched pages as plain UTF-8 instead of honoring declared encodings. Rather than build a new decoder, they exported the charset-aware one already used in web_fetch and plugged it into the same path. They then checked the change through the live production route with the SSRF guard on.
How it went
On an Aozora Bunko Shift_JIS page, replacement characters dropped from 208,953 to 0. A second legacy site went from 13 to 0. The maintainer also replayed it through a built Gateway before merging.
Tips
If your agent already has a charset-aware utility, reuse it before adding a second decoder. For web-fetch fixes, verify the full path on real pages and watch for no-charset cases, since strict decoding can reject them.

Try it yourself with OpenClaw

In my [project] codebase, find why the step that reads fetched web pages is turning text from [encoding or language] into replacement characters. Reuse the existing charset-aware decoder if one already exists, instead of creating a new parsing path. Add or update a test with a real sample page in that encoding, then run the fix through the normal production flow against [real URL]. Before anything irreversible happens, pause and show me the planned change and test results for approval.

Fill in the [brackets]. Agents can make mistakes, so review anything before it is sent, paid or deleted.

Get 3 agent uses like this every morning

With the day's top AI news. Free, and one click to unsubscribe.