rework interface, convert to python, fully support utf-8