BLD: ipython_directive, handle non-ascii execution results

@jorisvandenbossche I think this is a clean solution to non-unicode
output we discussed, specifically the problem in io.rst. This should
produce the right output on windows if I'm not wrong, and be amenable
to py3 compat to boot. If you confirm that it's good, this is clean enough
to try and get upstream, completing the effort.