Windows uses CRLF (
0D 0A) line endings while Unix just uses LF (
Most modern (i.e., since 2004 or so) Unix-like systems make UTF-8 the default character encoding.
Windows, however, lacks native support for UTF-8. It internally works in UTF-16, and assumes that
char-based strings are in a legacy code page. Fortunately, Notepad is capable of reading UTF-8 files; unfortunately, "ANSI" encoding is still the default.
Problematic Special Characters
Windows (rarely) uses Ctrl+Z as an end-of-file character. For example, if you
type a file at the command prompt, it will be truncated at the first
On Unix, Ctrl+Z is nothing special.
U+FEFF ZERO WITH NO-BREAK SPACE (Byte-Order Mark)
On Windows, UTF-8 files often start with a "byte order mark"
EF BB BF to distinguish them from ANSI files.
On Linux, the BOM is discouraged because it breaks things like shebang lines in shell scripts. Plus, it'd be pointless to have a UTF-8 signature when UTF-8 is the default encoding anyway.