fix scoring of 4 byte charsets
This commit is contained in:
parent
9a1fcba3d1
commit
aa2b5cc910
2 changed files with 7 additions and 7 deletions
12
charset.c
12
charset.c
|
|
@ -596,7 +596,7 @@ static int probe_ucs2le(__unused__ QECharset *charset, const u8 *buf, int size)
|
|||
return 0;
|
||||
}
|
||||
}
|
||||
if (count_spaces + count_lines > size / 16)
|
||||
if (count_spaces + count_lines > size / (16 * 2))
|
||||
return 1;
|
||||
else
|
||||
return 0;
|
||||
|
|
@ -732,7 +732,7 @@ static int probe_ucs2be(__unused__ QECharset *charset, const u8 *buf, int size)
|
|||
return 0;
|
||||
}
|
||||
}
|
||||
if (count_spaces + count_lines > size / 16)
|
||||
if (count_spaces + count_lines > size / (16 * 2))
|
||||
return 1;
|
||||
else
|
||||
return 0;
|
||||
|
|
@ -872,11 +872,11 @@ static int probe_ucs4le(__unused__ QECharset *charset, const u8 *buf, int size)
|
|||
if (!(magic & (1 << c)))
|
||||
return 0;
|
||||
} else
|
||||
if (c >= 0x10000) {
|
||||
if (c > 0x10FFFF) {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
if (count_spaces + count_lines > size / 16)
|
||||
if (count_spaces + count_lines > size / (16 * 4))
|
||||
return 1;
|
||||
else
|
||||
return 0;
|
||||
|
|
@ -1002,11 +1002,11 @@ static int probe_ucs4be(__unused__ QECharset *charset, const u8 *buf, int size)
|
|||
if (!(magic & (1 << c)))
|
||||
return 0;
|
||||
} else
|
||||
if (c >= 0x10000) {
|
||||
if (c > 0x10FFFF) {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
if (count_spaces + count_lines > size / 16)
|
||||
if (count_spaces + count_lines > size / (16 * 4))
|
||||
return 1;
|
||||
else
|
||||
return 0;
|
||||
|
|
|
|||
2
qe.c
2
qe.c
|
|
@ -1923,7 +1923,7 @@ void do_show_coding_system(EditState *s)
|
|||
|
||||
void do_set_auto_coding(EditState *s, int verbose)
|
||||
{
|
||||
u8 buf[4097];
|
||||
u8 buf[4096];
|
||||
int buf_size;
|
||||
EditBuffer *b = s->b;
|
||||
EOLType eol_type = b->eol_type;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue