result += "\\\'";
else if(c=='\\')
result += "\\\\";
- else if(static_cast<unsigned char>(c)<' ' || (escape_8bit && (c&0x80)))
+ else if(static_cast<unsigned char>(c)<' ' || c==0x7F || (escape_8bit && (c&0x80)))
{
char buf[4] = { '\\', 0 };
for(unsigned j=0; j<3; ++j)