From bcf00627ba371f9e978ea5cee332d89bb5f68d76 Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Wed, 3 Apr 2013 11:24:44 +0200 Subject: [PATCH] Marcdump -c tries to make more readable strings For chr values 32 - 126 the charcter is produced verbatim. --- util/marcdump.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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"); -- 1.7.10.4