Better handle unicode content

@sduenas @andygrunwald Please review