fix encode error when without zlib extenstion