Treat non-ASCII characters as erroneous when converting ASCII text

This commit is contained in:
Alex Dowad 2020-11-05 23:27:07 +02:00
parent 8f6889b20d
commit a416f938f3

View File

@ -79,7 +79,12 @@ const struct mbfl_convert_vtbl vtbl_wchar_ascii = {
*/
int mbfl_filt_conv_ascii_wchar(int c, mbfl_convert_filter *filter)
{
return (*filter->output_function)(c, filter->data);
if (c < 0x80) {
(*filter->output_function)(c, filter->data);
} else {
(*filter->output_function)(c | MBFL_WCSGROUP_THROUGH, filter->data);
}
return c;
}