This is going to be an evolving post. In the meantime, using cq or DQ, something like this will return the uri of the default collation:
Some other useful MarkLogic encoding tools include url-encode:
Both techniques could be used in a situation where you're sending characters that would require encoding/decoding using xdmp:get-request-field.
codepoints-to-string will return an xs:string from a series of unicode codepoints (as an example taken from the API docs):
- ► 2011 (35)
- ▼ 2010 (43)
- ► 2009 (37)
- ► 2008 (24)