encyclopegia.org

Binary-safe

A binary-safe function treats its input as a raw stream of bytes and ignores every textual aspect it may have. The term is mainly used in the PHP programming language to describe expected behaviour when passing binary data into functions whose main responsibility is text and string manipulating, and is used widely in the official PHP documentation.

A binary-safe function treats its input as a raw stream of bytes and ignores every textual aspect it may have. The term is mainly used in the PHP programming language to describe expected behaviour when passing binary data into functions whose main responsibility is text and string manipulating, and is used widely in the official PHP documentation. ==Binary-safe file read and write== While all textual data can be represented in binary form, it must be done so through character encoding. In addition to this, how newlines are represented may vary depending on the platform used. Windows, Linux and macOS all represent newlines differently in binary form. This means that reading a file as binary data, parsing it as text and then writing it back to disk (thus reconverting it back to binary form) may result in a different binary representation than the one originally used. Most programming languages let the programmer decide whether to parse the contents of a file as text or read it as binary data. To convey this intent, special flags or different functions exist when reading or writing files to disk. For example, in the PHP, C, and C++ programming languages, developers have to use fopen($filename, "rb") instead of fopen($filename, "r") to read the file as a binary stream instead of interpreting the textual data as such. This may also be referred to as reading in 'binary safe' mode. ==References==

References

No reference rows published for this article.

Cite this article

MLA

"Binary-safe." encyclopegia.org, 2026, https://encyclopegia.org/wiki/binary-safe. Accessed 24 November 2026.

Chicago

"Binary-safe." encyclopegia.org. Accessed November 24, 2026. https://encyclopegia.org/wiki/binary-safe.

APA

encyclopegia.org. (2026). Binary-safe. Retrieved November 24, 2026, from https://encyclopegia.org/wiki/binary-safe

Accessed November 24, 2026 · CC BY-SA 4.0 · citation page · JSON

Related articles

Djedkhonsuefankh

enwiki · references available

Ban'etsu West Line

enwiki · references available

Pelly-Nisutlin

enwiki · references available

Triholm railway station

enwiki · references available

Randpark Ridge

enwiki · references available

Nikon F90

enwiki · references available
CC BY-SA 4.0 · share-alike · https://en.wikipedia.org/w/index.php?oldid=1358897947 · 0.5 · snapshot enwiki-001358897947

Cite · JSON · Search

Related services and records

Services

  • Estate — measured countries, lanes and facts
  • Intel — live corroborated events
  • Legal — statutes, cases and citations
  • Encyclopedia — articles with inline sources
  • Space — launches, satellites and orbits
  • Search — federated search and reports
  • Pass — passport account and SSO
  • Corpora — read-only corpus origins
  • e01 — self-hosted corpora and tools

Text and metadata only; each target carries its own sources. Missing data is published as no-data, never estimated.