src/test.py: Encode strings only if they are not already using unicode.
Filter: Fix @rot13 with non-ascii strings.
Filter: Fix encoding issues in tests.