imbajin opened a new pull request, #3281: URL: https://github.com/apache/hugegraph/pull/3281
## Purpose of the PR Before: REST request bodies use the JVM default charset. In a US-ASCII JVM, Unicode vertex IDs become `?` during creation, while UTF-8 URL encoding preserves the original ID during lookup, resulting in a 404. After: OkHttp encodes text request bodies as UTF-8 by default and declares the charset. Explicit caller-provided charsets remain supported. ## Main Changes - Use OkHttp's string request-body factory instead of platform-dependent `String.getBytes()`. - Check serialized JSON string/object bodies, gzip bodies, and an explicit ISO-8859-1 body. - Repeat the existing REST test class in a US-ASCII JVM in Commons CI, asserting the actual default charset. ## Verifying these changes - [x] Need tests and can be verified as follows: Commons CI runs `UnitTestSuite` and repeats `AbstractRestClientTest` with `JAVA_TOOL_OPTIONS=-Dfile.encoding=US-ASCII -Dhugegraph.test.expectedCharset=US-ASCII`. CI validation is pending. Only source inspection and `git diff --check` were performed locally; no local build or runtime test was run. ## Does this PR potentially affect the following parts? - [ ] Dependencies - [ ] Modify configurations - [ ] The public API - [x] Other affects: internal HTTP request-body encoding and its CI regression coverage. - [ ] Nope ## Documentation Status - [x] `Doc - No Need`: fixes internal request encoding without changing configuration or public API. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
