From: Adam Dickmeiss Date: Wed, 3 Apr 2013 09:24:44 +0000 (+0200) Subject: Marcdump -c tries to make more readable strings X-Git-Tag: v4.2.52~4 X-Git-Url: http://sru.miketaylor.org.uk/?a=commitdiff_plain;h=bcf00627ba371f9e978ea5cee332d89bb5f68d76;p=yaz-moved-to-github.git Marcdump -c tries to make more readable strings For chr values 32 - 126 the charcter is produced verbatim. --- diff --git a/util/marcdump.c b/util/marcdump.c index e0491c4..f92204e 100644 --- a/util/marcdump.c +++ b/util/marcdump.c @@ -398,7 +398,10 @@ static void dump(const char *fname, const char *from, const char *to, { if ((i & 15) == 0) fprintf(cfile, " \""); - fprintf(cfile, "\\x%02X", p[i] & 255); + if (p[i] < 32 || p[i] > 126) + fprintf(cfile, "\" \"\\x%02X\" \"", p[i] & 255); + else + fputc(p[i], cfile); if (i < r - 1 && (i & 15) == 15) fprintf(cfile, "\"\n");