411 REFERENCE · Wikibooks
C++ Language/Std/FilesystemAccess/NewlineConvertedFiles
Reference material by Wikibooks contributors. This retains its source identity and is not 411 news reporting.
If you know that a file's data is to be interpreted as characters, then you could choose to have special operating-system-conversion of every newline character.
To use that kind of "newline-converted-file", open it with "w+" instead of "w+b".
Additional information about newline-converted-files