eliminated useless allocations in Encoding::{encode,decode}.