Merge pull request #2646 from npwoods/use_better_utf8_from_uchar_overload

Using a better overload of utf8_from_uchar() in ioport_field::key_name (nw)
This commit is contained in:
ajrhacker 2017-09-10 13:21:59 -04:00 committed by GitHub
commit 39c88f66b8

View File

@ -841,12 +841,7 @@ std::string ioport_field::key_name(int which) const
// if that doesn't work, convert to UTF-8
if (ch > 0x7F || isprint(ch))
{
char buf[10];
int count = utf8_from_uchar(buf, ARRAY_LENGTH(buf), ch);
buf[count] = 0;
return std::string(buf);
}
return utf8_from_uchar(ch);
// otherwise, opt for question marks
return "???";