general: Add workaround for Windows bug in various uses of isprint()
See #994; there is a regression in certain versions of the Windows CRT that gives the wrong result for isprint(). This adds workarounds to various potentially affected locations where isprint() is being used.