Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[#3165] fix(client-java): Fix the http client toJson encode without UTF-8 #3179

Merged
merged 6 commits into from
Apr 30, 2024

Conversation

xloya
Copy link
Contributor

@xloya xloya commented Apr 24, 2024

What changes were proposed in this pull request?

Currently in the java client, the json result is not encoded with UTF-8 when requesting the server, which will cause some Chinese characters to be garbled.It will use ISO_8859_1 as default. This PR fixed this.
image

Why are the changes needed?

Fix: #3165

How was this patch tested?

Add some ITs.

@xloya
Copy link
Contributor Author

xloya commented Apr 24, 2024

@jerryshao Could you please take a look of this? Thanks.

@xloya xloya changed the title [#3165] fix(client-java): Fix client json encode with utf-8 [#3165] fix(client-java): Fix the http client toJson encode without UTF-8 Apr 25, 2024
"这是中文comment",
Fileset.Type.MANAGED,
storageLocation,
ImmutableMap.of("k1", "v1"));
Copy link
Contributor

Choose a reason for hiding this comment

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

I think it is not just a comment that is affected by this issue, but also like storageLocation, property key and value, right? Can you also add tests to cover this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Add some assertions for this.

@jerryshao jerryshao added need backport Issues that need to backport to another branch branch-0.5 labels Apr 30, 2024
Copy link
Contributor

@jerryshao jerryshao left a comment

Choose a reason for hiding this comment

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

LGTM.

@jerryshao jerryshao merged commit d6fe135 into apache:main Apr 30, 2024
22 checks passed
github-actions bot pushed a commit that referenced this pull request Apr 30, 2024
… UTF-8 (#3179)

### What changes were proposed in this pull request?

Currently in the java client, the json result is not encoded with
`UTF-8` when requesting the server, which will cause some Chinese
characters to be garbled.It will use `ISO_8859_1` as default. This PR
fixed this.

![image](https://github.com/datastrato/gravitino/assets/26177232/9342dd32-1ded-4670-a3c7-37d9a5673955)

### Why are the changes needed?

Fix: #3165 

### How was this patch tested?

Add some ITs.

---------

Co-authored-by: xiaojiebao <[email protected]>
diqiu50 pushed a commit to diqiu50/gravitino that referenced this pull request Jun 13, 2024
…ithout UTF-8 (apache#3179)

### What changes were proposed in this pull request?

Currently in the java client, the json result is not encoded with
`UTF-8` when requesting the server, which will cause some Chinese
characters to be garbled.It will use `ISO_8859_1` as default. This PR
fixed this.

![image](https://github.com/datastrato/gravitino/assets/26177232/9342dd32-1ded-4670-a3c7-37d9a5673955)

### Why are the changes needed?

Fix: apache#3165 

### How was this patch tested?

Add some ITs.

---------

Co-authored-by: xiaojiebao <[email protected]>
@xloya xloya deleted the issue-3165 branch June 20, 2024 01:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
need backport Issues that need to backport to another branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug report] fileset commet meet garbled data
2 participants