resovle encode bug