Data update

This commit is contained in:
Ingy döt Net 2024-07-13 15:19:22 -07:00
parent 29a5eea0d4
commit 5c1bb7bfa9
2011 changed files with 35081 additions and 3229 deletions

View file

@ -1,5 +1,5 @@
val .finish = fn(.s) b2s map fn(.x) number(.x, 16), rest split "%", .s
val .decode = fn(.s) replace .s, re/(%[0-9A-Fa-f]{2})+/, .finish
val finish = fn s:b2s(map(fn x:number(x, 16), rest(split("%", s))))
val decode = fn s:replace(s, re/(%[0-9A-Fa-f]{2})+/, finish)
writeln .decode("http%3A%2F%2Ffoo%20bar%2F")
writeln .decode("google.com/search?q=%60Abdu%27l-Bah%C3%A1")
writeln decode("http%3A%2F%2Ffoo%20bar%2F")
writeln decode("google.com/search?q=%60Abdu%27l-Bah%C3%A1")

View file

@ -0,0 +1,9 @@
uses System;
function URLDecode(s: string) := Uri.UnescapeDataString(s);
begin
Println(URLDecode('http%3A%2F%2Ffoo%20bar%2F'));
Println(URLDecode('google.com/search?q=%60Abdu%27l-Bah%C3%A1'));
Println(URLDecode('%25%32%35'));
end.