#10790: make append work when output codec is different from input codec

There's still a bug here (the encode call shouldn't use the 'errors'
paramter), but I'll fix that later.
4 files changed