Utf-8 input handling functions