move encoding hook invocations to state machine
save user confirming the encoding of a file