Skip to content

fix(slides): make IconPark JSON output encoding-safe - #2484

Open
dajiaohuang wants to merge 1 commit into
larksuite:mainfrom
dajiaohuang:fix/2479-iconpark-encoding
Open

fix(slides): make IconPark JSON output encoding-safe#2484
dajiaohuang wants to merge 1 commit into
larksuite:mainfrom
dajiaohuang:fix/2479-iconpark-encoding

Conversation

@dajiaohuang

@dajiaohuang dajiaohuang commented Aug 24, 2026

Copy link
Copy Markdown

Summary

Keep IconPark's machine-readable stdout usable on non-UTF-8 Windows locales by emitting non-ASCII JSON characters as standard escape sequences. JSON consumers receive the same decoded values without depending on the console code page.

Changes

  • Serialize IconPark JSON with ASCII-safe escapes.
  • Add a subprocess regression test that forces PYTHONIOENCODING=cp1252.

Test Plan

  • python skills/lark-slides/scripts/iconpark_tool_test.py -k non_utf8_stdout
  • PYTHONUTF8=1 python skills/lark-slides/scripts/iconpark_tool_test.py (21 tests)
  • python -m py_compile skills/lark-slides/scripts/iconpark_tool.py skills/lark-slides/scripts/iconpark_tool_test.py
  • node scripts/skill-format-check/index.js
  • Manual native Windows run with PYTHONIOENCODING=cp1252 returned parseable JSON

Related Issues

Summary by CodeRabbit

  • Bug Fixes

    • Improved JSON output compatibility by escaping non-ASCII characters.
    • Ensured generated JSON remains valid when displayed in environments using non-UTF-8 encodings.
  • Tests

    • Added coverage for encoding-safe command-line output.
    • Enhanced test support for custom environment settings.

@github-actions github-actions Bot added the size/M Single-domain feat or fix with limited business impact label Aug 24, 2026
@coderabbitai

coderabbitai Bot commented Aug 24, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: bd0086ac-24fb-487b-bac2-74ef2e85a9ab

📥 Commits

Reviewing files that changed from the base of the PR and between 35bd5ec and 8828691.

📒 Files selected for processing (2)
  • skills/lark-slides/scripts/iconpark_tool.py
  • skills/lark-slides/scripts/iconpark_tool_test.py

Included review availability: Your plan provides up to 10 included reviews per hour; 8 remain after this review.


📝 Walkthrough

Walkthrough

The IconPark CLI now emits JSON with escaped non-ASCII characters. Tests can set subprocess environment variables and verify valid, ASCII-safe output under PYTHONIOENCODING=cp1252.

Changes

IconPark JSON output

Layer / File(s) Summary
ASCII-safe serialization and CLI validation
skills/lark-slides/scripts/iconpark_tool.py, skills/lark-slides/scripts/iconpark_tool_test.py
write_json enables ASCII escaping. The CLI test helper accepts custom environment variables. A regression test validates JSON output under cp1252 encoding.

Estimated code review effort: 2 (Simple) | ~10 minutes

Merge Risk: ⚪ Minimal · up to 88286

The change makes IconPark JSON safe for non-UTF-8 Windows locales while preserving decoded values; no actionable merge-blocking risk remains after normal checks and review.

Suggested reviewers: liangshuo-1, ethan-zhx

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: making IconPark JSON output safe for non-UTF-8 environments.
Description check ✅ Passed The description includes all required sections and provides clear scope, changes, related issue, and comprehensive test results.
Linked Issues check ✅ Passed The implementation uses ASCII-safe JSON escapes and adds the requested non-UTF-8 subprocess regression coverage for issue #2479.
Out of Scope Changes check ✅ Passed All changes directly support encoding-safe IconPark output and its regression tests, with no unrelated modifications identified.
Docstring Coverage ✅ Passed Docstring check was indeterminate for this PR — some files could not be analyzed in time. Not blocking.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/M Single-domain feat or fix with limited business impact

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(slides): make IconPark JSON output safe on non-UTF-8 Windows consoles

1 participant