Noncharacters U+FFFF and U+FFFE are not invalid.
Properly decode them and accept to encode them.

This was clarified by Unicode Technical Committee:
http://www.unicode.org/versions/corrigendum9.html