docs and comments
properly encode strings