Version-Release number of selected component (if applicable): mc-4.5.55-12 Whatever the mc-4.5.55-mb.patch is supposed to do, it doesn't: + if((*text & 0xC0) == 0xC0) { /* start of multi byte char + if((*text & 0xC0) != 0x80) + len = 2; + else if((*text & 0xC0) != 0x800) + len = 3; + else if((*text & 0xC0) != 0x10000) + len = 4; + SLsmg_write_nstring(text, len); + text = text + len; + } The above is equivalent to + if((*text & 0xC0) == 0xC0) { /* start of multi byte char + len = 2; + SLsmg_write_nstring(text, len); + text = text + len; + } (that is: the nested ifs are completely bogus (the first is always true, the second and third are always false)). I haven't looked at the surrounding code and just guess that text is supposed to point at an UTF-8 text, so the following may be as bogus as the original patch. It's nice that Czech will work now, but what about the languages which use more than 11 bits (2 UTF-8 chars) of character code space? FWIW, the right way to test UTF-8 character length: len = 1; // if ((*text & 0xC0) == 0x80) CHAR_IS_BOGUS; else if ((*text & 0xC0) == 0xC0) { if (*text < 0xE0) len = 2; else if (*text < 0xF0) len = 3; else if (*text < 0xF8) len = 4; // and so on } Not to mention that the maximal length of UTF-8 character is 6, not 4 as in the patch.
This patch is not present in current rawhide.