encode text to bytes using charmap instead of ascii; charmap can actually represent every possible byte in a byte string
diff --git a/OpenSSL/test/util.py b/OpenSSL/test/util.py
index 59d6a60..f6e9291 100644
--- a/OpenSSL/test/util.py
+++ b/OpenSSL/test/util.py
@@ -21,7 +21,7 @@
     bytes = str
 else:
     def b(s):
-        return s.encode("ascii")
+        return s.encode("charmap")
     bytes = bytes