diff options
Diffstat (limited to 'src/docbookgen.cpp')
-rw-r--r-- | src/docbookgen.cpp | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/src/docbookgen.cpp b/src/docbookgen.cpp index db11c67..3615ad5 100644 --- a/src/docbookgen.cpp +++ b/src/docbookgen.cpp @@ -101,9 +101,21 @@ inline void writeDocbookCodeString(FTextStream &t,const char *s, int &col) case '&': t << "&"; col++; break; case '\'': t << "'"; col++; break; case '"': t << """; col++; break; - case '\007': t << "^G"; col++; break; // bell - case '\014': t << "^L"; col++; break; // form feed - default: t << c; col++; break; + default: + { + uchar uc = static_cast<uchar>(c); + static const char *hex="0123456789ABCDEF"; + if (uc<32) + { + t << "$" << hex[uc>>4] << hex[uc&0xF] << ";"; + } + else + { + t << c; + } + col++; + } + break; } } } |