fix moe code and unicode coding