tju-yxq opened a new pull request, #1425: URL: https://github.com/apache/rocketmq-dashboard/pull/1425
## What is the purpose of the change Fixes #1424 When truncating a message body larger than 64 KB for display, the truncation point could fall in the middle of a multi-byte UTF-8 character (CJK, emoji, etc.). The decoder with `CodingErrorAction.REPORT` would throw `CharacterCodingException`, and the body would be displayed as BASE64 instead of readable text. ## Brief changelog - **`RocketMQMessageProvider.java`**: Added UTF-8 character boundary adjustment before decoding. When truncation is needed, walk back from the truncation point past any continuation bytes (`10xxxxxx`) and the leading byte (`11xxxxxx`) to land on a complete character boundary. ## Verifying this change 1. Produce a message with >64KB UTF-8 text containing multi-byte characters near the 64KB boundary. 2. Query the message in Studio. 3. Before fix: body shows as BASE64. 4. After fix: body shows as readable UTF-8 text with truncation indicator. - [x] Make sure there is a Github issue filed for the change. - [x] Format the pull request title like `[ISSUE #1424] ...`. - [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why. - [x] Write necessary unit-test to verify your logic correction. - [x] Run `mvn -B clean apache-rat:check findbugs:findbugs checkstyle:checkstyle` to make sure basic checks pass. - [ ] If this contribution is large, please file an Apache Individual Contributor License Agreement. -- 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]
