Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#137: bin/base64: windows: ensure stdout is binary-clean
In some Windows environments, `stdout' automatically changes newlines to CRLFs. This is bad when encoding, because the encoded file will have the wrong line terminators, and it is bad when decoding, because the decoded data might get mangled. It turns out that the best method to make `stdout' binary-clean is with: _setmode(1, _O_BINARY); Equivalent uses of `freopen()' and `SetConsoleMode()' do not always work because they can run into permissions errors, whereas it seems that `_setmode()' does not have that problem. Resolves #137.
- Loading branch information