flowable / flowable/flowable-engine

fullMessageBytes in CommentEntityImpl is platform dependent

Open
#3,397 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
9.5k
Forks
2.9k
Avg merge
7h 8m
Merged PRs (30d)
2

Description

**Describe the bug**
The comment entity uses new String(byte[] bytes)/String#getBytes() to encode/decode the full message bytes, which may cause messy if there are multiple servers with different character encoding.

**Expected behavior**
The encoding and decoding should be consistent across different servers.

I suggest to use UTF8 to encode/decode, the code should be something like:
```java
public byte[] getFullMessageBytes() {
return (fullMessage != null ? fullMessage.getBytes(StandardCharsets.UTF_8) : null);
}

public void setFullMessageBytes(byte[] fullMessageBytes) {
fullMessage = (fullMessageBytes != null ? new String(fullMessageBytes, StandardCharsets.UTF_8) : null);
}
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.