Skip to content

Commit 5596615

Browse files
serylsparkprime
authored andcommitted
Change escape range to 0080-009F to match the latin-1 charset
1 parent 5852e82 commit 5596615

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

stdlib/std.jsonnet

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -853,7 +853,7 @@ limitations under the License.
853853
'\\t'
854854
else
855855
local cp = std.codepoint(ch);
856-
if cp < 32 || (cp >= 126 && cp <= 159) then
856+
if cp < 32 || (cp >= 128 && cp <= 159) then
857857
'\\u%04x' % [cp]
858858
else
859859
ch;

test_suite/stdlib.jsonnet

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -260,6 +260,7 @@ std.assertEqual(std.escapeStringJson('he"llo'), '"he\\"llo"') &&
260260
std.assertEqual(std.escapeStringJson('he"llo'), '"he\\"llo"') &&
261261
std.assertEqual(std.escapeStringBash("he\"l'lo"), "'he\"l'\"'\"'lo'") &&
262262
std.assertEqual(std.escapeStringDollars('The path is ${PATH}.'), 'The path is $${PATH}.') &&
263+
std.assertEqual(std.escapeStringJson('!~'), '"!~"') &&
263264

264265
std.assertEqual(std.manifestPython({
265266
x: 'test',

test_suite/stdlib.jsonnet.golden

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
TRACE: stdlib.jsonnet:580
21
TRACE: stdlib.jsonnet:581
32
TRACE: stdlib.jsonnet:582
43
TRACE: stdlib.jsonnet:583
@@ -8,5 +7,6 @@ TRACE: stdlib.jsonnet:586
87
TRACE: stdlib.jsonnet:587
98
TRACE: stdlib.jsonnet:588
109
TRACE: stdlib.jsonnet:589
11-
TRACE: stdlib.jsonnet:590 Some Trace Message
10+
TRACE: stdlib.jsonnet:590
11+
TRACE: stdlib.jsonnet:591 Some Trace Message
1212
true

0 commit comments

Comments
 (0)