doctest: fix unicode errors, handle triple-quoted input