{
char hexbyte[8];
for (string::const_iterator i = in.begin(); i != in.end(); ++i) {
- if (*i <= '%') {
- snprintf(hexbyte, sizeof(hexbyte), "%%%02x", (unsigned)*i);
+ if (*i <= '#') {
+ snprintf(hexbyte, sizeof(hexbyte), "#%02x", (unsigned)*i);
out->append(hexbyte);
- } else if (*i >= 126) {
+ } else if (*i >= '~') {
snprintf(hexbyte, sizeof(hexbyte), "~%02x", (unsigned)*i);
out->append(hexbyte);
} else {
{
const char *orig_p = p;
while (*p && *p != '!') {
- if (*p == '%' || *p == '~') {
+ if (*p == '#' || *p == '~') {
unsigned hex;
int r = sscanf(++p, "%2x", &hex);
if (r < 1)