Skip to content

Refactor UTF-8 usage to StandardCharsets.UTF_8 and centralize constant definition#6999

Merged
hansva merged 2 commits intoapache:mainfrom
leehaut:hotfix/lance-common-60
Apr 15, 2026
Merged

Refactor UTF-8 usage to StandardCharsets.UTF_8 and centralize constant definition#6999
hansva merged 2 commits intoapache:mainfrom
leehaut:hotfix/lance-common-60

Conversation

@leehaut
Copy link
Copy Markdown
Contributor

@leehaut leehaut commented Apr 14, 2026

This PR improves encoding handling by standardizing UTF-8 usage across the codebase and simplifying exception management.

  • Extracted the UTF-8 string constant into a shared Const class:
    String UTF_8 = "UTF-8";

  • Updated URLEncoder.encode(routingPolicyString, "UTF-8") to use StandardCharsets.UTF_8:
    URLEncoder.encode(routingPolicyString, StandardCharsets.UTF_8)

  • Removed unnecessary UnsupportedEncodingException handling, as StandardCharsets.UTF_8 is guaranteed to be available.

…t definition

Signed-off-by: lance <leehaut@gmail.com>
…t definition

Signed-off-by: lance <leehaut@gmail.com>
@hansva hansva merged commit f5aaecd into apache:main Apr 15, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants