Closed thorsten-fluegel closed 3 years ago
Interesting. I think the fix should be:
else if (std::isprint(*i))
*out << "'" << *i << "', ";
else
*out << static_cast<int>(*i) << ", ";
this takes care of the signedness of char by itself. I tested this with signed chars with some UTF-8 patterns to produce negative ints. Should work fine on systems with unsigned chars, because the C standard says that int and char are convertible.
Thanks!
Fixes #105