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:
parent
61b3358740
commit
05ab3dc386
6 changed files with 113 additions and 11 deletions
3
buffer.c
3
buffer.c
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue