U: encode method