Add some decode/encode for supporting python3