diff --git a/src/core/Utils.mjs b/src/core/Utils.mjs
index e4411fe0..273eca1e 100755
--- a/src/core/Utils.mjs
+++ b/src/core/Utils.mjs
@@ -201,11 +201,18 @@ class Utils {
* Utils.parseEscapedChars("\\n");
*/
static parseEscapedChars(str) {
- return str.replace(/(\\)?\\([bfnrtv0'"]|x[\da-fA-F]{2}|u[\da-fA-F]{4}|u\{[\da-fA-F]{1,6}\})/g, function(m, a, b) {
+ return str.replace(/(\\)?\\([bfnrtv'"]|[0-3][0-7]{2}|[0-7]{1,2}|x[\da-fA-F]{2}|u[\da-fA-F]{4}|u\{[\da-fA-F]{1,6}\})/g, function(m, a, b) {
if (a === "\\") return "\\"+b;
switch (b[0]) {
case "0":
- return "\0";
+ case "1":
+ case "2":
+ case "3":
+ case "4":
+ case "5":
+ case "6":
+ case "7":
+ return String.fromCharCode(parseInt(b, 8));
case "b":
return "\b";
case "t":
diff --git a/src/core/operations/UnescapeString.mjs b/src/core/operations/UnescapeString.mjs
index 62eab48e..1a625582 100644
--- a/src/core/operations/UnescapeString.mjs
+++ b/src/core/operations/UnescapeString.mjs
@@ -20,7 +20,7 @@ class UnescapeString extends Operation {
this.name = "Unescape string";
this.module = "Default";
- this.description = "Unescapes characters in a string that have been escaped. For example, Don\\'t stop me now
becomes Don't stop me now
.
Supports the following escape sequences:
\\n
(Line feed/newline)\\r
(Carriage return)\\t
(Horizontal tab)\\b
(Backspace)\\f
(Form feed)\\xnn
(Hex, where n is 0-f)\\\\
(Backslash)\\'
(Single quote)\\"
(Double quote)\\unnnn
(Unicode character)\\u{nnnnnn}
(Unicode code point)Don\\'t stop me now
becomes Don't stop me now
.\\n
(Line feed/newline)\\r
(Carriage return)\\t
(Horizontal tab)\\b
(Backspace)\\f
(Form feed)\\nnn
(Octal, where n is 0-7)\\xnn
(Hex, where n is 0-f)\\\\
(Backslash)\\'
(Single quote)\\"
(Double quote)\\unnnn
(Unicode character)\\u{nnnnnn}
(Unicode code point)