Report question

Question: How do I detect if have to apply UTF-8 decode or encode on a string?