encoding/charmap: don't map U+FFFD in encoder

Illegal bytes in the charmap are mapped to U+FFFD on decoding. On the
encoding side, this was resulting in a reverse entry mapping U+FFFD to
the first illegal byte in the charmap. This skips over U+FFFD when
collecting the data for the encoding tables.

Change-Id: Id7612ed6fd1aed6e0b0bdf1e68e68cb60e167135
Reviewed-on: https://go-review.googlesource.com/17764
Reviewed-by: Marcel van Lohuizen <mpvl@golang.org>
2 files changed