mirror of
https://github.com/gchq/CyberChef.git
synced 2026-02-06 11:06:45 +00:00
Exclude Delete character from hex dump output (#2086)
Co-authored-by: GCHQ Developer C85297 <95289555+C85297@users.noreply.github.com>
This commit is contained in:
parent
a30f5f1b50
commit
dd26c09003
@ -177,7 +177,7 @@ class Utils {
|
||||
*/
|
||||
static printable(str, preserveWs=false, onlyAscii=false) {
|
||||
if (onlyAscii) {
|
||||
return str.replace(/[^\x20-\x7f]/g, ".");
|
||||
return str.replace(/[^\x20-\x7e]/g, ".");
|
||||
}
|
||||
|
||||
// eslint-disable-next-line no-misleading-character-class
|
||||
|
||||
@ -20,4 +20,10 @@ TestRegister.addApiTests([
|
||||
assert.equal(Utils.parseEscapedChars("\\\\\\'"), "\\'");
|
||||
}),
|
||||
|
||||
it("Utils: should replace delete character", () => {
|
||||
assert.equal(
|
||||
Utils.printable("\x7e\x7f\x80\xa7", false, true),
|
||||
"\x7e...",
|
||||
);
|
||||
}),
|
||||
]);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user