fix some issues with characte encoding