Skip to content

fix(binding/java): decode Java’s modified UTF-8 format#3195

Merged
tisonkun merged 3 commits intoapache:mainfrom
G-XD:fix_java_binding
Sep 27, 2023
Merged

fix(binding/java): decode Java’s modified UTF-8 format#3195
tisonkun merged 3 commits intoapache:mainfrom
G-XD:fix_java_binding

Conversation

@G-XD
Copy link
Copy Markdown
Contributor

@G-XD G-XD commented Sep 26, 2023

Fix: #3194

@G-XD G-XD requested a review from tisonkun as a code owner September 26, 2023 17:22
@github-actions github-actions Bot added the releases-note/fix The PR fixes a bug or has a title that begins with "fix" label Sep 26, 2023
Copy link
Copy Markdown
Member

@tisonkun tisonkun left a comment

Choose a reason for hiding this comment

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

Let's factor out this repeat conversion into jstring_to_string:

fn jstring_to_string(env: &mut JNIEnv, s: &JString) -> Result<String> {
    let res = unsafe { env.get_string_unchecked(&s)? };
    Ok(res.into())
}

I suspect we may have more thoughts on this conversion, so open to change.

Comment thread bindings/java/src/lib.rs
@tisonkun tisonkun merged commit 9315df4 into apache:main Sep 27, 2023
@tisonkun
Copy link
Copy Markdown
Member

Thank you!

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

Labels

releases-note/fix The PR fixes a bug or has a title that begins with "fix"

Projects

None yet

Development

Successfully merging this pull request may close these issues.

java binding will cause invalid utf-8 sequence error if passed path parameter contains emoji

3 participants