Skip to content

Commit

Permalink
Update TextDecoder encoding
Browse files Browse the repository at this point in the history
  • Loading branch information
lutzroeder committed Dec 11, 2024
1 parent 6c844fd commit 1e1018d
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion source/circle.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ circle.Model = class {
if (data) {
switch (metadata.name) {
case 'min_runtime_version': {
const decoder = new TextDecoder();
const decoder = new TextDecoder('utf-8');
this.runtime = decoder.decode(data);
break;
}
Expand Down
2 changes: 1 addition & 1 deletion source/mlnet.js
Original file line number Diff line number Diff line change
Expand Up @@ -467,7 +467,7 @@ mlnet.ModelHeader = class {
const stream = this._entries.get(name) || this._entries.get(name.replace(/\//g, '\\'));
if (stream) {
const buffer = stream.peek();
const decoder = new TextDecoder();
const decoder = new TextDecoder('utf-8');
return decoder.decode(buffer);
}
return null;
Expand Down
2 changes: 1 addition & 1 deletion source/paddle.js
Original file line number Diff line number Diff line change
Expand Up @@ -730,7 +730,7 @@ paddle.NaiveBuffer = class {
if (this.meta_version >= 2) {
reader.skip(2);
}
const decoder = new TextDecoder();
const decoder = new TextDecoder('utf-8');
const opt_version = reader.read(16);
const version = decoder.decode(opt_version.slice(0, opt_version.indexOf(0x00)));
this.format = `Paddle Lite${version && version.match(/^v\d+\.\d+.\d+$/) ? ` ${version}` : ''}`;
Expand Down
2 changes: 1 addition & 1 deletion source/tf.js
Original file line number Diff line number Diff line change
Expand Up @@ -1452,7 +1452,7 @@ tf.TensorBundle.Table.Block = class {
for (let i = 0; i < numRestarts; i++) {
restartOffsets.push(reader.int32());
}
const decoder = new TextDecoder();
const decoder = new TextDecoder('utf-8');
for (let i = 0; i < numRestarts; i++) {
reader.seek(restartOffsets[i]);
let key = '';
Expand Down
2 changes: 1 addition & 1 deletion source/tflite.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ tflite.Model = class {
if (data) {
switch (metadata.name) {
case 'min_runtime_version': {
const decoder = new TextDecoder();
const decoder = new TextDecoder('utf-8');
this.runtime = decoder.decode(data);
break;
}
Expand Down

0 comments on commit 1e1018d

Please sign in to comment.