doc: encoding is ignored if input is a Buffer

NOTE: it wasn't in 0.8

fix #6386