update demo,fix "encode twice" problem