What is the Windows definition of a text file?

Shane 46 Reputation points
2023-05-07T14:49:41.44+00:00

POSIX provides a definition for what qualifies as a text file, and the ISO C standard also provides a definition for what qualifies as a text file.

(The ISO C standard also provides a definition for what qualifies as a binary file - POSIX explicitly states that it does not provide a definition for what qualifies as a binary file.)

Of course, Windows is non-POSIX, and therefore may have a different definition for what qualifies as a text file from a Windows perspective. Windows might also have a more strict (or less strict) notion of a text file than the ISO C standard.

Does a clear definition for what qualifies as a text file from a Windows perspective exist anywhere in the Microsoft documentation for Windows or Visual C++?

POSIX also defines a line. Again, as Windows is non-POSIX, does Windows have its own definition of a line?

Windows for business | Windows Server | User experience | Other
Windows for business | Windows Client for IT Pros | User experience | Other
Developer technologies | C++
{count} votes

1 answer

Sort by: Most helpful
  1. Limitless Technology 44,751 Reputation points
    2023-05-09T14:43:48.4066667+00:00

    Hello

    Thank you for your question and reaching out.

    As per wikipedia .org

    Each line of text is separated from the next by the two-character combinations carriage return (CR) and line feed (LF) in the text file format used by MS-DOS and Microsoft Windows. Many text editors, including Notepad, do not automatically insert a CR-LF marker at the end of the last line of text since it is typical for the last line of text to not be finished with one.

    On Microsoft Windows operating systems, a file is considered a text file if its "filename extension" is the letter "txt." For text files with particular functions, there are numerous different suffixes that are utilized.

    The majority of Microsoft Windows text files are encoded using ANSI, OEM, Unicode, or UTF-8. The single-byte ISO/IEC 8859 encodings that Microsoft Windows nomenclature refers to as "ANSI encodings" are typically what the Microsoft Notepad menus refer to as "System Code Page," a legacy, non-Unicode encoding.

    --If the reply is helpful, please Upvote and Accept as answer--


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.