doc: encoding is ignored if input is a Buffer

NOTE: it wasn't in 0.8

fixes #6386