flowable / flowable/flowable-engine

fullMessageBytes in CommentEntityImpl is platform dependent

Aperta
#3,397 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
Java
Stelle
9.5k
Fork
2.9k
Merge medio
7h 8m
PR unite (30g)
2

Descrizione

**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);
}
```

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.