finish decode/encode for windows platform