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
|
### Fixed
|
||||||
- `WakuMessage.payloadAsUtf8` returning garbage on utf-8 non-ascii characters.
|
- `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
|
## [0.9.0] - 2021-07-26
|
||||||
|
|
||||||
|
|
|
@ -60,10 +60,6 @@ export class ChatMessage {
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
|
|
||||||
return Array.from(this.proto.payload)
|
return Buffer.from(this.proto.payload).toString('utf-8');
|
||||||
.map((char) => {
|
|
||||||
return String.fromCharCode(char);
|
|
||||||
})
|
|
||||||
.join('');
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue