From 395ce69d5ae119571907e58b061505b54bf32ed7 Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Fri, 17 Jun 2011 22:12:45 -0700 Subject: [PATCH] sys-file-writer: Write variable names in mrsets in lowercase. SPSS appears to write the short names of the variables in a multiple response set in lowercase, so this commit make PSPP do the same. Thanks to Curt Reinhold for providing the .sav file that led to this discovery. --- doc/dev/system-file-format.texi | 7 ++++--- src/data/sys-file-writer.c | 1 + 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/doc/dev/system-file-format.texi b/doc/dev/system-file-format.texi index 84b3f66f..6276b6de 100644 --- a/doc/dev/system-file-format.texi +++ b/doc/dev/system-file-format.texi @@ -676,7 +676,8 @@ following: @itemize @bullet @item -The set's name (an identifier that begins with @samp{$}). +The set's name (an identifier that begins with @samp{$}), in mixed +upper and lower case. @item An equals sign (@samp{=}). @@ -717,8 +718,8 @@ written if LABELSOURCE=VARLABEL was specified. A space. @item -The names of the variables in the set, each separated from the -previous by a single space. +The short names of the variables in the set, converted to lowercase, +each separated from the previous by a single space. @item A line feed (byte 0x0a). diff --git a/src/data/sys-file-writer.c b/src/data/sys-file-writer.c index 0aeb93a0..6c9d4617 100644 --- a/src/data/sys-file-writer.c +++ b/src/data/sys-file-writer.c @@ -700,6 +700,7 @@ write_mrsets (struct sfm_writer *w, const struct dictionary *dict, const char *short_name_utf8 = var_get_short_name (mrset->vars[j], 0); char *short_name = recode_string (encoding, "UTF-8", short_name_utf8, -1); + str_lowercase (short_name); ds_put_format (&s, " %s", short_name); free (short_name); } -- 2.30.2