+ default:
+ if ((s[i] & 0x80) != 0)
+ {
+ // Construct a hexadecimal entity
+ const char hexdigit[] = "0123456789abcdef";
+ char entity[] = "&#x..;";
+
+ entity[3] = hexdigit[(s[i] >> 4) & 0x0F];
+ entity[4] = hexdigit[ s[i] & 0x0F];
+
+ s(i,1) = entity;
+ i++;
+ }
+ else if (s[i] < ' ' && s[i] != '\t' && s[i] != '\r')
+ {
+ std::cerr << "WARNING: discarding illegal character " << int(s[i]) << "\n";
+ s(i,1) = "";
+ i++;
+ }