mirror of
https://github.com/gchq/CyberChef.git
synced 2025-04-20 14:56:19 -04:00
File shim now translates correctly
This commit is contained in:
parent
d080c5dd14
commit
2019ae43d7
7 changed files with 14 additions and 28 deletions
|
@ -472,7 +472,6 @@ class Utils {
|
|||
const str = Utils.byteArrayToChars(byteArray);
|
||||
try {
|
||||
const utf8Str = utf8.decode(str);
|
||||
|
||||
if (str.length !== utf8Str.length) {
|
||||
if (ENVIRONMENT_IS_WORKER()) {
|
||||
self.setOption("attemptHighlight", false);
|
||||
|
@ -966,12 +965,12 @@ class Utils {
|
|||
if (!Utils.isNode()) {
|
||||
throw new TypeError("Browser environment cannot support readFileSync");
|
||||
}
|
||||
let bytes = [];
|
||||
for (const byte of file.data.values()) {
|
||||
bytes = bytes.concat(byte);
|
||||
}
|
||||
|
||||
console.log('readFileSync:');
|
||||
console.log(file);
|
||||
console.log(Buffer.from(file.data).toString());
|
||||
|
||||
return Buffer.from(file.data).buffer;
|
||||
return bytes;
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue