Files
openclaw/scripts/format-docs.mjs
wings1029 796ee27b3a fix(scripts): keep format-docs output tails UTF-8 safe (#110825)
* fix(scripts): keep format-docs output tails UTF-8 safe

When formatter (oxfmt) error output exceeds the 16 KiB tail cap and the
retained byte window starts inside a multibyte UTF-8 character, the
diagnostic tail would begin with a replacement character (�).

Add a decodeUtf8Tail helper that skips leading UTF-8 continuation bytes
before decoding the byte suffix, matching the existing pattern in
scripts/run-additional-boundary-checks.mjs (#109167).

Keep the existing 16 KiB cap and ASCII behavior unchanged.

* refactor(scripts): share UTF-8-safe output tails

Co-authored-by: 陈志强0668000989 <chen.zhiqiang1@xydigit.com>

* test(scripts): prove real formatter UTF-8 failures

---------

Co-authored-by: Peter Steinberger <steipete@gmail.com>
2026-07-29 08:29:24 -04:00

7.8 KiB