mirror of https://github.com/waku-org/js-waku.git
Fixed `ChatMessage.payloadAsUtf8` returning garbage on utf-8 non-ascii
This commit is contained in:
parent
1f692f1683
commit
45dc8f81c9
|
@ -17,6 +17,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||
|
||||
### Fixed
|
||||
- `WakuMessage.payloadAsUtf8` returning garbage on utf-8 non-ascii characters.
|
||||
- `ChatMessage.payloadAsUtf8` returning garbage on utf-8 non-ascii characters.
|
||||
|
||||
## [0.9.0] - 2021-07-26
|
||||
|
||||
|
|
|
@ -60,10 +60,6 @@ export class ChatMessage {
|
|||
return '';
|
||||
}
|
||||
|
||||
return Array.from(this.proto.payload)
|
||||
.map((char) => {
|
||||
return String.fromCharCode(char);
|
||||
})
|
||||
.join('');
|
||||
return Buffer.from(this.proto.payload).toString('utf-8');
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue