Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fopen in binary mode #141

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Commits on Sep 15, 2019

  1. fopen in binary mode

    some shitty OS's (for example MS Windows) may corrupt binary data like the sample .jpg files with fopen text mode, and the default fopen mode if none is specified, may be text mode (the only instances i can think of off-hand is MS Windows and classic MacOS, and PHP does not even support classic MacOS, but Windows is supported), quoting the docs:
    
    > The default translation mode depends on the SAPI and version of PHP that you are using, so you are encouraged to always specify the appropriate flag for portability reasons. You should use the 't' mode if you are working with plain-text files and you use \n to delimit your line endings in your script, but expect your files to be readable with applications such as notepad. You should use the 'b' in all other cases.
    
    so.. for Windows-portability reasons, one should pretty much always fopen in binary mode.
    divinity76 committed Sep 15, 2019
    Configuration menu
    Copy the full SHA
    3252c87 View commit details
    Browse the repository at this point in the history