Commit 9bce290e authored by rswindell's avatar rswindell
Browse files

In print_utf8_as_cp437(): if a sequence is an invalid UTF-8 sequence, assume

it's a CP437 character (e.g. inadvertently included in a UTF-8 encoded text)
and display as such.
parent b5b19d9a
......@@ -331,7 +331,8 @@ size_t sbbs_t::print_utf8_as_cp437(const char* str, size_t len)
enum unicode_codepoint codepoint = UNICODE_UNDEFINED;
len = utf8_getc(str, len, &codepoint);
if((int)len < 2) {
lprintf(LOG_NOTICE, "Invalid UTF-8 sequence: %02X (error = %d)", (uchar)*str, (int)len);
outchar(*str); // Assume it's a CP437 character
lprintf(LOG_DEBUG, "Invalid UTF-8 sequence: %02X (error = %d)", (uchar)*str, (int)len);
return 1;
}
for(int i = 1; i < 0x100; i++) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment