Working encoding and decoding