Skip to content

Use StringUtils.isASCII to check if a string contains non-ASCII characters#3931

Merged
Glavo merged 1 commit into
HMCL-dev:mainfrom
Glavo:opt
May 22, 2025
Merged

Use StringUtils.isASCII to check if a string contains non-ASCII characters#3931
Glavo merged 1 commit into
HMCL-dev:mainfrom
Glavo:opt

Conversation

@Glavo
Copy link
Copy Markdown
Member

@Glavo Glavo commented May 22, 2025

No description provided.

@Glavo Glavo requested a review from Copilot May 22, 2025 16:21
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

This PR updates the modpack and installer pages to use the new StringUtils.isASCII check instead of directly using StandardCharsets for ASCII validation.

  • Replace explicit StandardCharsets.US_ASCII.newEncoder().canEncode calls with StringUtils.isASCII for improved readability and encapsulation.
  • Remove unused StandardCharsets imports.

Reviewed Changes

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

File Description
HMCL/src/main/java/org/jackhuang/hmcl/ui/download/LocalModpackPage.java Replaced explicit ASCII encoding check with StringUtils.isASCII
HMCL/src/main/java/org/jackhuang/hmcl/ui/download/InstallersPage.java Implemented StringUtils.isASCII for ASCII validation and cleaned up imports

@Glavo Glavo changed the title Use StringUtils.isASCII Use StringUtils.isASCII to check if a string contains non-ASCII characters May 22, 2025
@Glavo Glavo merged commit bb37e3f into HMCL-dev:main May 22, 2025
2 checks passed
@Glavo Glavo deleted the opt branch May 22, 2025 16:25
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