pipe accepts an encoding option

If this idea is blessed I will add a test for it.