Remap unicode control codes.
When running NetHack.exe in a console set to code page 850, the multi-byte to wide character mapping will generate unicode values in the unicode control code range. These values need to be re-mapped to unicode renderable glyphs using the same mappings we use for control page 437 otherwise the console font might not render a character for these unicode control values.
This commit is contained in:
@@ -1664,6 +1664,12 @@ void set_cp_map()
|
||||
int count = MultiByteToWideChar(codePage, 0, &c, 1,
|
||||
&console.cpMap[i], 1);
|
||||
nhassert(count == 1);
|
||||
|
||||
// If a character was mapped to unicode control codes,
|
||||
// remap to the appropriate unicode character per our
|
||||
// code page 437 mappings.
|
||||
if (console.cpMap[i] < 32)
|
||||
console.cpMap[i] = cp437[console.cpMap[i]];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user