What are some common character encodings that a text editor should support?

character, encoding, text-editor, unicode

Solution

Definitely UTF-8. See http://www.joelonsoftware.com/articles/Unicode.html.

As far as I know, there's no guaranteed way to detect this automatically (although the probability of a mistaken diagnosis can be reduced to a very small amount by scanning).

Problem

I have a text editor that can load ASCII and Unicode files. It automatically detects the encoding by looking for the BOM at the beginning of the file and/or searching the first 256 bytes for characters > 0x7f. What other encodings should be supported, and what characteristics would make that encoding easy to auto-detect?

Original source