mirror of
https://github.com/arduino/arduino-ide.git
synced 2025-07-13 06:16:33 +00:00
Fix corruption of incoming UTF-8-encoded serial data (#1758)
* Fix corruption of incoming UTF-8-encoded serial data * Make TextDecoder() readonly because it can be Co-authored-by: z3bra <111462146+z3bra5hax@users.noreply.github.com>
This commit is contained in:
parent
f8c01e379c
commit
7c86f1f9d3
@ -80,6 +80,7 @@ export class MonitorService extends CoreClientAware implements Disposable {
|
||||
private readonly board: Board;
|
||||
private readonly port: Port;
|
||||
private readonly monitorID: string;
|
||||
private readonly streamingTextDecoder = new TextDecoder('utf8');
|
||||
|
||||
/**
|
||||
* The lightweight representation of the port configuration currently in use for the running monitor.
|
||||
@ -319,7 +320,7 @@ export class MonitorService extends CoreClientAware implements Disposable {
|
||||
const message =
|
||||
typeof data === 'string'
|
||||
? data
|
||||
: new TextDecoder('utf8').decode(data);
|
||||
: this.streamingTextDecoder.decode(data, {stream:true});
|
||||
this.messages.push(...splitLines(message));
|
||||
},
|
||||
},
|
||||
|
Loading…
x
Reference in New Issue
Block a user