api: ensure only UTF-8 encoded snippets are posted