fix: correct Utf8String encoding and dynamic array handling for non-ASCII strings (#1841)#2289
Open
Dev10-sys wants to merge 1 commit intoLFDT-web3j:mainfrom
Open
Conversation
…-web3j#1841) - fixed Utf8String.bytes32PaddedLength calculation to use actual byte length for non-ASCII characters - updated TypeEncoder to correctly identify and encode static arrays of dynamic types with proper offsets - added comprehensive test cases for Chinese strings, long multi-byte strings, and empty strings - resolved compilation issues in existing tests on Windows by replacing literal characters with Unicode escapes - updated CHANGELOG.md with the bug fix entry Signed-off-by: Dev10-sys <kalpanagola9897@gmail.com>
b806b2f to
7524f6d
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fixes incorrect handling of UTF-8 strings (e.g., Chinese text) which could lead to wrong encoding or transaction failures.
The string length calculation has been updated to use actual UTF-8 byte length with proper ABI padding and array encoding has been corrected to handle static arrays containing dynamic types properly.
Additional tests have been added to cover non-ASCII strings and edge cases.
Fixes #1841