Fix uri format to follow RFC 3986 (#2157)

This commit is contained in:
itchyny authored and GitHub committed 2023-07-13 23:23:23 +09:00
1 parent 55249e29be
commit 689a4e660b
2 files changed
+12 -12

No files matched your search

+1 -1
View File
@@ -645,7 +645,7 @@ static jv f_format(jq_state *jq, jv input, jv fmt) {
input = f_tostring(jq, input); input = f_tostring(jq, input);
int unreserved[128] = {0}; int unreserved[128] = {0};
const char* p = CHARS_ALPHANUM "-_.!~*'()"; const char* p = CHARS_ALPHANUM "-_.~";
while (*p) unreserved[(int)*p++] = 1; while (*p) unreserved[(int)*p++] = 1;
jv line = jv_string(""); jv line = jv_string("");
+11 -11
View File
@@ -61,17 +61,17 @@ null
null null
"interpolation" "interpolation"
@text,@json,([1,.] | (@csv, @tsv)),@html,@uri,@sh,@base64,(@base64 | @base64d) @text,@json,([1,.]|@csv,@tsv),@html,@uri,@sh,(@base64|.,@base64d)
"<>&'\"\t" "!()<>&'\"\t"
"<>&'\"\t" "!()<>&'\"\t"
"\"<>&'\\\"\\t\"" "\"!()<>&'\\\"\\t\""
"1,\"<>&'\"\"\t\"" "1,\"!()<>&'\"\"\t\""
"1\t<>&'\"\\t" "1\t!()<>&'\"\\t"
"&lt;&gt;&amp;&apos;&quot;\t" "!()&lt;&gt;&amp;&apos;&quot;\t"
"%3C%3E%26'%22%09" "%21%28%29%3C%3E%26%27%22%09"
"'<>&'\\''\"\t'" "'!()<>&'\\''\"\t'"
"PD4mJyIJ" "ISgpPD4mJyIJ"
"<>&'\"\t" "!()<>&'\"\t"
# regression test for #436 # regression test for #436
@base64 @base64