fixed python 3 encoding bugs in corpus.doctest and allow it to succeed on windows