Fix JQL Japanese character encoding issue #10
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Problem
When using Japanese characters in JQL queries (e.g.,
labels="テスト"), the following error occurred:However, the same query works correctly when using curl with
--data-urlencodeoption.Root Cause
In
JiraClient.java:228, theStringEntityconstructor was called without specifying character encoding:Apache HttpClient 4.x defaults to ISO-8859-1 encoding when no encoding is specified, which causes Japanese characters to be incorrectly encoded when sent to the JIRA API.
This issue was introduced in commit 2692818 "use new jql search API (#6)" when the implementation was changed to use POST requests with JSON body instead of GET requests with query parameters.
Changes
Modified Files
src/main/java/org/embulk/input/jira/client/JiraClient.javaStandardCharsetsimportnew StringEntity(body)tonew StringEntity(body, StandardCharsets.UTF_8)src/test/java/org/embulk/input/jira/client/JiraClientTest.javatest_searchIssues_withJapaneseJql()to verify Japanese JQL queries work correctlysrc/test/resources/jira_client.jsonTesting
🤖 Generated with Claude Code