URL decoding: Difference between revisions
Content deleted Content added
Added Algol 68 |
m Note does not support UTF-8. |
||
Line 88: | Line 88: | ||
=={{header|ALGOL 68}}== |
=={{header|ALGOL 68}}== |
||
{{works with|ALGOL 68G|Any - tested with release 2.8.3.win32}} |
|||
Algol 68 G has only 8-bit characters, so examples requiring UTF-8 cannot be handled. |
|||
<lang algol68># returns c decoded as a hex digit # |
<lang algol68># returns c decoded as a hex digit # |
||
PROC hex value = ( CHAR c )INT: IF c >= "0" AND c <= "9" THEN ABS c - ABS "0" |
PROC hex value = ( CHAR c )INT: IF c >= "0" AND c <= "9" THEN ABS c - ABS "0" |
||
Line 122: | Line 124: | ||
# test the url decode procedure # |
# test the url decode procedure # |
||
print( ( url decode( "http%3A%2F%2Ffoo%20bar%2F" ), newline ) ) |
print( ( url decode( "http%3A%2F%2Ffoo%20bar%2F" ), newline ) ) |
||
print( ( url decode( "google.com/search?q=%60Abdu%27l-Bah%C3%A1" ), newline ) ) |
|||
</lang> |
</lang> |
||
{{out}} |
{{out}} |
||
<pre> |
<pre> |
||
http://foo bar/ |
http://foo bar/ |
||
google.com/search?q=`Abdu'l-Bahá |
|||
</pre> |
</pre> |
||