Skip to content

fix(skill): support custom charset for zip extraction#1276

Open
fang-tech wants to merge 2 commits intoagentscope-ai:mainfrom
fang-tech:feat/skill-unzip-charset-option
Open

fix(skill): support custom charset for zip extraction#1276
fang-tech wants to merge 2 commits intoagentscope-ai:mainfrom
fang-tech:feat/skill-unzip-charset-option

Conversation

@fang-tech
Copy link
Copy Markdown
Contributor

AgentScope-Java Version

1.0.11

Description

  • add Charset overloads to SkillUtil.createFromZip(...) for byte arrays, paths, and input streams
  • use the provided charset to decode zip entry names and text content during extraction
  • document that this option is intended for non-UTF-8 zip packages that may fail with malformed input during entry decoding

Checklist

Please check the following items before code is ready to be reviewed.

  • Code has been formatted with mvn spotless:apply
  • All tests are passing (mvn test)
  • Javadoc comments are complete and follow project conventions
  • Related documentation has been updated (e.g. links, examples, etc.)
  • Code is ready for review

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds support for non-UTF-8 zip skill packages by allowing callers to specify the Charset used when decoding zip entry names and extracted text content.

Changes:

  • Added Charset overloads for SkillUtil.createFromZip(...) across byte arrays, paths, and input streams.
  • Updated zip extraction to use the provided charset for entry-name decoding and text decoding.
  • Added a unit test that validates extraction using a GBK-encoded zip.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 6 comments.

File Description
agentscope-core/src/main/java/io/agentscope/core/skill/util/SkillUtil.java Adds charset-aware createFromZip overloads and uses charset for ZipInputStream + content decoding.
agentscope-core/src/test/java/io/agentscope/core/skill/SkillUtilTest.java Adds a GBK-based zip extraction test and charset-aware zip test helper.

Comment thread agentscope-core/src/main/java/io/agentscope/core/skill/util/SkillUtil.java Outdated
Comment thread agentscope-core/src/main/java/io/agentscope/core/skill/util/SkillUtil.java Outdated
Comment thread agentscope-core/src/main/java/io/agentscope/core/skill/util/SkillUtil.java Outdated
Comment thread agentscope-core/src/main/java/io/agentscope/core/skill/util/SkillUtil.java Outdated
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 24, 2026

Codecov Report

❌ Patch coverage is 69.23077% with 4 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
.../java/io/agentscope/core/skill/util/SkillUtil.java 69.23% 3 Missing and 1 partial ⚠️

📢 Thoughts on this report? Let us know!

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants