URL encoding: Difference between revisions

Content added Content deleted
(Added 11l)
Line 43: Line 43:
<lang 11l>F url_encode(s)
<lang 11l>F url_encode(s)
V r = ‘’
V r = ‘’
V i = 0
V buf = ‘’
V buf = ‘’


Line 53: Line 52:
@buf = ‘’
@buf = ‘’


L i < s.len
L(c) s
V c = s[i]
I c C (‘0’..‘9’, ‘a’..‘z’, ‘A’..‘Z’, ‘_’, ‘.’, ‘-’, ‘~’)
I c C (‘0’..‘9’, ‘a’..‘z’, ‘A’..‘Z’, ‘_’, ‘.’, ‘-’, ‘~’)
flush_buf()
flush_buf()
Line 60: Line 58:
E
E
buf ‘’= c
buf ‘’= c
i++


flush_buf()
flush_buf()