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:
みけCAT
2026-01-29 15:00:17 +00:00
committed by GitHub
co-authored by GCHQ Developer C85297
parent a30f5f1b50
commit dd26c09003
2 changed files with 7 additions and 1 deletions
+1 -1
View File
@@ -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
+6
View File
@@ -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...",
);
}),
]);