This change prevents us from generating corrupt messages when we are confused about codepage settings, and makes Windows errors consistent with the rest of our logs. Fixes bug 22520; bugfix on 0.1.2.8-alpha. Patch from "Vort".