Add encoding parameter to top-level functions (fixes issue20).
Fix highlighter language in documentation.