Improve charset detection and handling

* add charset_raw for binary files
* improve charset detection for ambiguous cases
* add do_show_coding_system()
* add do_set_auto_coding() to (re)select the best coding system
* handle BOM mark: display as \ufeff and ignore for syntax coloring
This commit is contained in:
Charlie Gordon 2014-02-10 20:29:26 +00:00
commit 05ab3dc386
6 changed files with 113 additions and 11 deletions

View file

@ -498,6 +498,9 @@ EditBuffer *eb_new(const char *name, int flags)
if (flags & BF_UTF8) {
eb_set_charset(b, &charset_utf8, b->eol_type);
} else
if (flags & BF_RAW) {
eb_set_charset(b, &charset_raw, EOL_UNIX);
} else {
/* CG: default charset should be selectable */
eb_set_charset(b, &charset_8859_1, b->eol_type);