From d309ed4eb1f5efa1da8fa1ee2a93001c891ddb0e Mon Sep 17 00:00:00 2001 From: Jamy Timmermans Date: Mon, 14 Dec 2015 22:27:15 +0100 Subject: [PATCH 1/2] Remove statement to not encode iso-8859-1 extended --- lib/escape.js | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/lib/escape.js b/lib/escape.js index 05f74ec..9a1fc72 100644 --- a/lib/escape.js +++ b/lib/escape.js @@ -42,9 +42,6 @@ module.exports = function (c, code, meta, options){ //Control sets 0 and 1 if (code < 160) return unicode (code); - //Printable 8-bit character - if (code < 256) return c; - //Latin1 multibyte character return options.unicode ? unicode (code) : c; -}; \ No newline at end of file +}; From b00b6d5d19cf9904867fc92a20c418b55d0613d2 Mon Sep 17 00:00:00 2001 From: Jamy Timmermans Date: Mon, 14 Dec 2015 22:27:48 +0100 Subject: [PATCH 2/2] Update tests to properly encode iso-8859-1 extended --- test/stringify.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/stringify.js b/test/stringify.js index 250c513..bcc0d53 100644 --- a/test/stringify.js +++ b/test/stringify.js @@ -15,7 +15,7 @@ var tests = { "iso-8859-1": function (){ var options = { unicode: true }; var data = properties.stringify ({ "¡": "ÿ", "Ā": "a" }, options); - var expected = "¡ = ÿ" + EOL + "\\u0100 = a"; + var expected = "\\u00a1 = \\u00ff" + EOL + "\\u0100 = a"; assert.strictEqual (data, expected); }, "comments multiline": function (){ @@ -156,4 +156,4 @@ var tests = { for (var test in tests){ tests[test] (); -} \ No newline at end of file +}