Changes

Jump to navigation Jump to search
997 bytes added ,  16:48, 13 May 2015
no edit summary
* <code><nowiki>web:create-url('http://find.me', map { 'q': 'dog' })</nowiki></code> returns <code><nowiki>http://find.me?q=dog</nowiki></code>
* <code><nowiki>web:create-url('search', map { 'year': (2000,2001), 'title':() })</nowiki></code> returns <code>search?year=2000&year=2001</code>
|}
 
==web:encode-url==
 
{| width='100%'
|-
| width='120' | '''Signatures'''
|{{Func|web:encode-url|$string as xs:string|xs:string}}<br/>
|-
| '''Summary'''
|Encodes a string to a URL. Spaces are rewritten to {{Code|+}}, and all other non-ASCII characters and special characters except for {{Code|*}} are percent-encoded.
|-
| '''Examples'''
|
* <code><nowiki>web:encode-url("this is a test!.html")</nowiki></code> returns <code>this+is+a+test%21.html</code>.
|}
 
==web:decode-url==
 
{| width='100%'
|-
| width='120' | '''Signatures'''
|{{Func|web:decode-url|$string as xs:string|xs:string}}<br/>
|-
| '''Summary'''
|Decodes a URL to the original string. Percent-encoded characters are decoded to their UTF8 codepoints, and {{Code|+}} characters are rewritten to spaces.
|-
| '''Examples'''
|
* <code><nowiki>web:decode-url("%E6%97%A5%E6%9C%AC%E8%AA%9E")</nowiki></code> returns <code>日本語</code>.
|}
=Changelog=
 
;Version 8.2
 
* Added: [[#web:encode-url|web:encode-url]], [[#web:decode-url|web:decode-url]]
The module was introduced with Version 8.1.
[[Category:XQuery]]
Bureaucrats, editor, reviewer, Administrators
13,550

edits

Navigation menu