Using C++ standard streams in binary mode through Swig/Python on MinGW
问题 I have a library written with C++ that uses standard streams to read and write objects. I also have a Python interface generated with Swig that I'm using to access the library. Everything works fine on Linux, but on Windows (on MinGW) it seems impossible to use C++ standard streams in binary mode through the Python interface. If the streams are used in text mode, the extra CR characters break the library. The standard streams are fully wrapped inside the C++ library, i.e. I'm not passing them