Text File Info
Text File Info
"Text file" refers to a type of container, while plain text refers to a type of
content. Text files can contain plain text, but they are not limited to such.
[citation needed]
At a generic level of description, there are two kinds of computer files: text
files and binary files.[1]
On most operating systems the name text file refers to file format that allows only
plain text content with very little formatting (e.g., no bold or italic types).
Such files can be viewed and edited on text terminals or in simple text editors.
Text files usually have the MIME type text/plain, usually with additional
information indicating an encoding.
Most Microsoft Windows text files use "ANSI", "OEM", "Unicode" or "UTF-8" encoding.
What Microsoft Windows terminology calls "ANSI encodings" are usually single-byte
ISO/IEC 8859 encodings (i.e. ANSI in the Microsoft Notepad menus is really "System
Code Page", non-Unicode, legacy encoding), except for in locales such as Chinese,
Japanese and Korean that require double-byte character sets. ANSI encodings were
traditionally used as default system locales within Microsoft Windows, before the
transition to Unicode. By contrast, OEM encodings, also known as DOS code pages,
were defined by IBM for use in the original IBM PC text mode display system. They
typically include graphical and line-drawing characters common in DOS applications.
"Unicode"-encoded Microsoft Windows text files contain text in UTF-16 Unicode
Transformation Format. Such files normally begin with Byte Order Mark (BOM), which
communicates the endianness of the file content. Although UTF-8 does not suffer
from endianness problems, many Microsoft Windows programs (i.e. Notepad) prepend
the contents of UTF-8-encoded files with BOM,[2] to differentiate UTF-8 encoding
from other 8-bit encodings.[3]
Additionally, POSIX defines a printable file as a text file whose characters are
printable or space or backspace according to regional rules. This excludes most
control characters, which are not printable.[6]
Being certified Unix, macOS uses POSIX format for text files.[8] Uniform Type
Identifier (UTI) used for text files in macOS is "public.plain-text"; additional,
more specific UTIs are: "public.utf8-plain-text" for utf-8-encoded text,
"public.utf16-external-plain-text" and "public.utf16-plain-text" for utf-16-encoded
text and "com.apple.traditional-mac-plain-text" for classic Mac OS text files.[7]