[encode] fix several int value bug on 32bit platform
fix testcases