Ensure stdin/stdout is in binary mode on windows when pickling.
diff --git a/scripts/unpickle.py b/scripts/unpickle.py
index efb8608..a3c274c 100755
--- a/scripts/unpickle.py
+++ b/scripts/unpickle.py
@@ -52,6 +52,15 @@
     if args:
         optparser.error('unexpected arguments')
 
+    # Change stdin to binary mode
+    try:
+        import msvcrt
+    except ImportError:
+        pass
+    else:
+        import os
+        msvcrt.setmode(sys.stdin.fileno(), os.O_BINARY)
+
     calls = 0
     startTime = time.time()
     while True: